MT#56374 add gettid() wrapper

... for older glibc which doesn't support it

Change-Id: I82cd49e6a10fd48861ae00c4eda06613f930fca7
pull/1759/head
Richard Fuchs 2 years ago
parent 125657e108
commit d6928c74f8

@ -9,6 +9,8 @@
#include <stdint.h> #include <stdint.h>
#include <stdbool.h> #include <stdbool.h>
#include <sys/resource.h> #include <sys/resource.h>
#include <unistd.h>
#include <sys/syscall.h>
#define THREAD_BUF_SIZE 64 #define THREAD_BUF_SIZE 64
@ -436,6 +438,12 @@ INLINE int rlim(int res, rlim_t val) {
return setrlimit(res, &rlim); return setrlimit(res, &rlim);
} }
#if defined(__GLIBC__) && (__GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 30))
INLINE pid_t gettid(void) {
return syscall(SYS_gettid);
}
#endif
/*** TAINT FUNCTIONS ***/ /*** TAINT FUNCTIONS ***/

Loading…
Cancel
Save