|
|
560544 |
commit b46023d525b6e38a096ff4fdf9e6a96c7d7b7d40
|
|
|
560544 |
Author: Mark Wielaard <mark@klomp.org>
|
|
|
560544 |
Date: Mon Mar 4 19:47:59 2019 +0100
|
|
|
560544 |
|
|
|
560544 |
Rename gettid() to gettid_sys() in gdbserver_tests.
|
|
|
560544 |
|
|
|
560544 |
glibc might defined gettid() itself through unistd.h:
|
|
|
560544 |
https://sourceware.org/bugzilla/show_bug.cgi?id=6399
|
|
|
560544 |
|
|
|
560544 |
Rename to gettid_sys() so we don't clash with the glibc definition.
|
|
|
560544 |
|
|
|
560544 |
diff --git a/gdbserver_tests/sleepers.c b/gdbserver_tests/sleepers.c
|
|
|
560544 |
index 5ffc6f8..dfda828 100644
|
|
|
560544 |
--- a/gdbserver_tests/sleepers.c
|
|
|
560544 |
+++ b/gdbserver_tests/sleepers.c
|
|
|
560544 |
@@ -15,7 +15,7 @@ static int sleepms = 1000; // in each loop, will sleep "sleepms" milliseconds
|
|
|
560544 |
static int burn = 0; // after each sleep, will burn cpu in a tight 'burn' loop
|
|
|
560544 |
static void setup_sigusr_handler(void); // sigusr1 and 2 sigaction setup.
|
|
|
560544 |
|
|
|
560544 |
-static pid_t gettid()
|
|
|
560544 |
+static pid_t gettid_sys()
|
|
|
560544 |
{
|
|
|
560544 |
#ifdef __NR_gettid
|
|
|
560544 |
return syscall(__NR_gettid);
|
|
|
560544 |
@@ -27,7 +27,7 @@ static pid_t gettid()
|
|
|
560544 |
static void whoami(char *msg) __attribute__((unused));
|
|
|
560544 |
static void whoami(char *msg)
|
|
|
560544 |
{
|
|
|
560544 |
- fprintf(stderr, "pid %ld Thread %ld %s\n", (long) getpid(), (long) gettid(),
|
|
|
560544 |
+ fprintf(stderr, "pid %ld Thread %ld %s\n", (long) getpid(), (long) gettid_sys(),
|
|
|
560544 |
msg);
|
|
|
560544 |
fflush(stderr);
|
|
|
560544 |
}
|
|
|
560544 |
diff --git a/gdbserver_tests/t.c b/gdbserver_tests/t.c
|
|
|
560544 |
index 228d4a4..b3e7a28 100644
|
|
|
560544 |
--- a/gdbserver_tests/t.c
|
|
|
560544 |
+++ b/gdbserver_tests/t.c
|
|
|
560544 |
@@ -16,7 +16,7 @@ static int loopmain, loopt1, loopt2;
|
|
|
560544 |
|
|
|
560544 |
static double pi = 3.14159265358979323846264338327950288;
|
|
|
560544 |
|
|
|
560544 |
-static pid_t gettid()
|
|
|
560544 |
+static pid_t gettid_sys()
|
|
|
560544 |
{
|
|
|
560544 |
#ifdef __NT_gettid
|
|
|
560544 |
return syscall(__NR_gettid);
|
|
|
560544 |
@@ -26,7 +26,7 @@ static pid_t gettid()
|
|
|
560544 |
}
|
|
|
560544 |
static void whoami(char *msg)
|
|
|
560544 |
{
|
|
|
560544 |
- printf("pid %ld Thread %ld %s\n", (long) getpid(), (long) gettid(), msg);
|
|
|
560544 |
+ printf("pid %ld Thread %ld %s\n", (long) getpid(), (long) gettid_sys(), msg);
|
|
|
560544 |
fflush(stdout);
|
|
|
560544 |
}
|
|
|
560544 |
|