diff options
| author | Waldemar Brodkorb <wbx@openadk.org> | 2026-01-09 18:44:02 +0100 |
|---|---|---|
| committer | Waldemar Brodkorb <wbx@openadk.org> | 2026-01-09 18:55:47 +0100 |
| commit | 47c15dbb50f07be1ef5a1ffc9559205584078fbc (patch) | |
| tree | d1b4f01caf76de35c624dd892b48ed63c33e00d5 /libpthread/nptl | |
| parent | 3dcc84c74ece048b62c992edceab9cce54446f57 (diff) | |
add gettid syscall wrapper
Diffstat (limited to 'libpthread/nptl')
| -rw-r--r-- | libpthread/nptl/sysdeps/unix/sysv/linux/Makefile.commonarch | 2 | ||||
| -rw-r--r-- | libpthread/nptl/sysdeps/unix/sysv/linux/gettid.c | 13 |
2 files changed, 14 insertions, 1 deletions
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/Makefile.commonarch b/libpthread/nptl/sysdeps/unix/sysv/linux/Makefile.commonarch index a438e9739..52b662327 100644 --- a/libpthread/nptl/sysdeps/unix/sysv/linux/Makefile.commonarch +++ b/libpthread/nptl/sysdeps/unix/sysv/linux/Makefile.commonarch @@ -68,7 +68,7 @@ libpthread_linux_CSRC += pthread_attr_getaffinity.c pthread_attr_setaffinity.c \ libpthread_linux_SSRC := #ptw-close.S ptw-open.S ptw-waitid.S ptw-waidpid.S ptw-write.S libc_linux_CSRC += libc_pthread_init.c libc_multiple_threads.c \ - register-atfork.c unregister-atfork.c getpid.c \ + register-atfork.c unregister-atfork.c getpid.c gettid.c \ raise.c jmp-unwind.c librt_linux_CSRC += mq_notify.c timer_create.c timer_delete.c \ diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/gettid.c b/libpthread/nptl/sysdeps/unix/sysv/linux/gettid.c new file mode 100644 index 000000000..80c2ed80f --- /dev/null +++ b/libpthread/nptl/sysdeps/unix/sysv/linux/gettid.c @@ -0,0 +1,13 @@ +/* Copyright (C) 2025 Waldemar Brodkorb <wbx@uclibc-ng.org> */ + +#include <unistd.h> +#include <tls.h> +#include <sysdep.h> + +pid_t +gettid (void) +{ + INTERNAL_SYSCALL_DECL (err); + pid_t result = INTERNAL_SYSCALL (gettid, err, 0); + return result; +} |
