]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Rename gettid() to gettid_sys() in gdbserver_tests.
authorMark Wielaard <mark@klomp.org>
Mon, 4 Mar 2019 18:47:59 +0000 (19:47 +0100)
committerMark Wielaard <mark@klomp.org>
Wed, 13 Mar 2019 12:34:01 +0000 (13:34 +0100)
glibc might defined gettid() itself through unistd.h:
https://sourceware.org/bugzilla/show_bug.cgi?id=6399

Rename to gettid_sys() so we don't clash with the glibc definition.

gdbserver_tests/sleepers.c
gdbserver_tests/t.c

index 5ffc6f8e3371de1b5b195fbe9dde42bf677c2709..dfda828c6e747f73300abb48a63f07f3bb5b2164 100644 (file)
@@ -15,7 +15,7 @@ static int sleepms = 1000; // in each loop, will sleep "sleepms" milliseconds
 static int burn = 0; // after each sleep, will burn cpu in a tight 'burn' loop 
 static void setup_sigusr_handler(void); // sigusr1 and 2 sigaction setup.
 
-static pid_t gettid()
+static pid_t gettid_sys()
 {
 #ifdef __NR_gettid
    return syscall(__NR_gettid);
@@ -27,7 +27,7 @@ static pid_t gettid()
 static void whoami(char *msg) __attribute__((unused));
 static void whoami(char *msg)
 {
-   fprintf(stderr, "pid %ld Thread %ld %s\n", (long) getpid(), (long) gettid(),
+   fprintf(stderr, "pid %ld Thread %ld %s\n", (long) getpid(), (long) gettid_sys(),
            msg);
    fflush(stderr);
 }
index 228d4a42e77b53cc5ce3e219c0c7a3cd4e70b239..b3e7a28d5c4e238d623917f01d3d69994be2ffca 100644 (file)
@@ -16,7 +16,7 @@ static int loopmain, loopt1, loopt2;
 
 static double pi = 3.14159265358979323846264338327950288;
 
-static pid_t gettid()
+static pid_t gettid_sys()
 {
 #ifdef __NT_gettid
    return syscall(__NR_gettid);
@@ -26,7 +26,7 @@ static pid_t gettid()
 }
 static void whoami(char *msg)
 {
-   printf("pid %ld Thread %ld %s\n", (long) getpid(), (long) gettid(), msg);
+   printf("pid %ld Thread %ld %s\n", (long) getpid(), (long) gettid_sys(), msg);
    fflush(stdout);
 }