[Bugfix] fix gettid method is not define (#16084)

Signed-off-by: rongfu.leng <rongfu.leng@daocloud.io>
This commit is contained in:
rongfu.leng 2025-04-09 10:12:44 +08:00 committed by GitHub
parent 2976dc27e9
commit 4e9cf8c1dd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -4,6 +4,11 @@
#include <string> #include <string>
#include <sched.h> #include <sched.h>
#endif #endif
#if __GLIBC__ == 2 && __GLIBC_MINOR__ < 30
#include <unistd.h>
#include <sys/syscall.h>
#define gettid() syscall(SYS_gettid)
#endif
#include "cpu_types.hpp" #include "cpu_types.hpp"