diff --git a/README.md b/README.md index 91f4b4c..43a7a77 100644 --- a/README.md +++ b/README.md @@ -63,12 +63,12 @@ used instead as this allocator fundamentally doesn't support that environment. ## Dependencies -Debian oldstable (currently Debian 9) determines the most ancient set of +Debian stable (currently Debian 10) determines the most ancient set of supported dependencies: -* glibc 2.24 -* Linux 4.9 -* Clang 3.8 or GCC 6.3 +* glibc 2.28 +* Linux 4.19 +* Clang 7.0 or GCC 8.3.0 However, using more recent releases is highly recommended. Older versions of the dependencies may be compatible at the moment but are not tested and will diff --git a/h_malloc.c b/h_malloc.c index d855e0e..998de6f 100644 --- a/h_malloc.c +++ b/h_malloc.c @@ -1156,7 +1156,7 @@ COLD static void init_slow_path(void) { mutex_unlock(&lock); // may allocate, so wait until the allocator is initialized to avoid deadlocking - if (atfork(full_lock, full_unlock, post_fork_child)) { + if (pthread_atfork(full_lock, full_unlock, post_fork_child)) { fatal_error("pthread_atfork failed"); } } diff --git a/random.c b/random.c index 0b4cbdc..8883531 100644 --- a/random.c +++ b/random.c @@ -5,17 +5,7 @@ #include "random.h" #include "util.h" -#if __has_include() -// glibc 2.25 and later #include -#else -#include -#include - -static ssize_t getrandom(void *buf, size_t buflen, unsigned int flags) { - return syscall(SYS_getrandom, buf, buflen, flags); -} -#endif static void get_random_seed(void *buf, size_t size) { while (size) { diff --git a/util.h b/util.h index 5f2274a..f22ece5 100644 --- a/util.h +++ b/util.h @@ -38,28 +38,11 @@ typedef uint32_t u32; typedef uint64_t u64; typedef unsigned __int128 u128; -// use __register_atfork directly to avoid linking with libpthread for glibc < 2.28 -#ifdef __GLIBC__ -#if !__GLIBC_PREREQ(2, 28) -extern void *__dso_handle; -extern int __register_atfork(void (*)(void), void (*)(void), void (*)(void), void *); -#define atfork(prepare, parent, child) __register_atfork(prepare, parent, child, __dso_handle) -#endif -#endif - -#ifndef atfork -#define atfork pthread_atfork -#endif - #if CONFIG_SEAL_METADATA #ifdef __GLIBC__ -#if __GLIBC_PREREQ(2, 27) #define USE_PKEY -#endif -#endif - -#ifndef USE_PKEY +#else #error "CONFIG_SEAL_METADATA requires Memory Protection Key support" #endif