unix: only include linux headers on glibc

On musl-libc the required types for `prctl` are defined in `sys/prctl.h` and including `linux/prctl.h` fails either because the file does not exist or because it redefines the types.
This commit is contained in:
Yuval Deutscher 2025-04-06 13:58:10 +03:00 committed by GitHub
parent af21001f7a
commit 4b4642f28e
WARNING! Although there is a key with this ID in the database it does not verify this commit! This commit is SUSPICIOUS.
GPG key ID: B5690EEEBB952194

View file

@ -31,11 +31,11 @@ terms of the MIT license. A copy of the license can be found in the file
#if defined(__linux__)
#include <features.h>
#include <linux/prctl.h> // PR_SET_VMA
//#if defined(MI_NO_THP)
#include <sys/prctl.h> // THP disable
//#endif
#if defined(__GLIBC__)
#include <linux/prctl.h> // PR_SET_VMA
#include <linux/mman.h> // linux mmap flags
#else
#include <sys/mman.h>