From: Mark Wielaard Date: Mon, 4 Mar 2019 18:47:59 +0000 (+0100) Subject: Rename gettid() to gettid_sys() in gdbserver_tests. X-Git-Tag: VALGRIND_3_15_0~57 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d15f70a92507c30717a6461258971fedcf3c20c2;p=thirdparty%2Fvalgrind.git Rename gettid() to gettid_sys() in gdbserver_tests. 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. --- diff --git a/gdbserver_tests/sleepers.c b/gdbserver_tests/sleepers.c index 5ffc6f8e33..dfda828c6e 100644 --- a/gdbserver_tests/sleepers.c +++ b/gdbserver_tests/sleepers.c @@ -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); } diff --git a/gdbserver_tests/t.c b/gdbserver_tests/t.c index 228d4a42e7..b3e7a28d5c 100644 --- a/gdbserver_tests/t.c +++ b/gdbserver_tests/t.c @@ -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); }