mirror of
https://github.com/plasma-umass/coz.git
synced 2024-09-11 04:55:25 +03:00
use own gettid() only for older glibc versions
gettid() is provided in glibc since version 2.30. Detect the glibc version with a macro and only define our own gettid() when glibc version < 2.30.
This commit is contained in:
parent
ab9cb71225
commit
0226150f3b
@ -1,6 +1,11 @@
|
||||
#if !defined(CCUTIL_THREAD_H)
|
||||
#define CCUTIL_THREAD_H
|
||||
|
||||
// gettid() is provided by glibc since version 2.30
|
||||
// only create our own implementation for older glibc versions
|
||||
#include <features.h>
|
||||
#if !__GLIBC_PREREQ(2,30)
|
||||
|
||||
#include <sys/syscall.h>
|
||||
|
||||
static inline pid_t gettid() {
|
||||
@ -8,3 +13,5 @@ static inline pid_t gettid() {
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user