Commit b0fe9dec authored by Mark Brown's avatar Mark Brown Committed by Paul E. McKenney

tools/nolibc: Implement gettid()

Allow test programs to determine their thread ID.
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
Cc: Willy Tarreau <w@1wt.eu>
Signed-off-by: default avatarWilly Tarreau <w@1wt.eu>
Signed-off-by: default avatarPaul E. McKenney <paulmck@kernel.org>
parent 7bdc0e7a
...@@ -1571,6 +1571,12 @@ pid_t sys_getpid(void) ...@@ -1571,6 +1571,12 @@ pid_t sys_getpid(void)
return my_syscall0(__NR_getpid); return my_syscall0(__NR_getpid);
} }
static __attribute__((unused))
pid_t sys_gettid(void)
{
return my_syscall0(__NR_gettid);
}
static __attribute__((unused)) static __attribute__((unused))
int sys_gettimeofday(struct timeval *tv, struct timezone *tz) int sys_gettimeofday(struct timeval *tv, struct timezone *tz)
{ {
...@@ -2029,6 +2035,18 @@ pid_t getpid(void) ...@@ -2029,6 +2035,18 @@ pid_t getpid(void)
return ret; return ret;
} }
static __attribute__((unused))
pid_t gettid(void)
{
pid_t ret = sys_gettid();
if (ret < 0) {
SET_ERRNO(-ret);
ret = -1;
}
return ret;
}
static __attribute__((unused)) static __attribute__((unused))
int gettimeofday(struct timeval *tv, struct timezone *tz) int gettimeofday(struct timeval *tv, struct timezone *tz)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment