fix: build on newer linux distributions

Newer linux distributions correctly define PR_XXX constants.
For older ones we should include <linux/prctl.h> explicitly.

Fixes https://github.com/microsoft/mimalloc/issues/1065

Signed-off-by: Roman Gershman <romange@gmail.com>
This commit is contained in:
Roman Gershman 2025-04-06 16:39:20 +03:00
parent af21001f7a
commit 296491e1c5
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: F25B77EAF8AEBA7A

View file

@ -31,10 +31,13 @@ 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
// Pick up missing definitions from linux headers.
#if !defined(PR_SET_VMA)
#include <linux/prctl.h> // PR_SET_VMA
#endif
#if defined(__GLIBC__)
#include <linux/mman.h> // linux mmap flags
#else