libselinux: fix build on musl
This commit is contained in:
parent
6d9b047a58
commit
945f484ae6
|
@ -0,0 +1,30 @@
|
|||
musl defines gettid(), current glibc is >2.30
|
||||
|
||||
--- a/src/procattr.c
|
||||
+++ b/src/procattr.c
|
||||
@@ -22,25 +22,6 @@
|
||||
static int destructor_key_initialized = 0;
|
||||
static __thread char destructor_initialized;
|
||||
|
||||
-/* Bionic and glibc >= 2.30 declare gettid() system call wrapper in unistd.h and
|
||||
- * has a definition for it */
|
||||
-#ifdef __BIONIC__
|
||||
- #define OVERRIDE_GETTID 0
|
||||
-#elif !defined(__GLIBC_PREREQ)
|
||||
- #define OVERRIDE_GETTID 1
|
||||
-#elif !__GLIBC_PREREQ(2,30)
|
||||
- #define OVERRIDE_GETTID 1
|
||||
-#else
|
||||
- #define OVERRIDE_GETTID 0
|
||||
-#endif
|
||||
-
|
||||
-#if OVERRIDE_GETTID
|
||||
-static pid_t gettid(void)
|
||||
-{
|
||||
- return syscall(__NR_gettid);
|
||||
-}
|
||||
-#endif
|
||||
-
|
||||
static void procattr_thread_destructor(void __attribute__((unused)) *unused)
|
||||
{
|
||||
if (prev_current != UNSET)
|
Loading…
Reference in New Issue