authorgravatar for hugo.beauzee@datadoghq.comHugo Beauzée-Luyssen <hugo.beauzee@datadoghq.com> 2025-02-07 11:59:57+01:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-02-08 01:02:28+01:00
loga06a7108c88d7571a87a69f7c9bd59af49d538ca
tree626d49240f12f1f23efc2185dcc9deb5a239e193
parent6a6e72fff820fb641aa1b00700f6835430dae72e

generic glibc: guard memfd_create & mlock2 declarations

They were introduced in glibc 2.27

1 files changed, 6 insertions(+), 1 deletions(-)

lib/libc/include/generic-glibc/bits/mman-shared.h+6-1
......@@ -50,6 +50,9 @@
5050
5151__BEGIN_DECLS
5252
53// zig patch: check target glibc version
54# if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 27) || __GLIBC__ > 2
55
5356/* Create a new memory file descriptor. NAME is a name for debugging.
5457 FLAGS is a combination of the MFD_* constants. */
5558int memfd_create (const char *__name, unsigned int __flags) __THROW;
......@@ -58,6 +61,8 @@ int memfd_create (const char *__name, unsigned int __flags) __THROW;
5861 memory. FLAGS is a combination of the MLOCK_* flags above. */
5962int mlock2 (const void *__addr, size_t __length, unsigned int __flags) __THROW;
6063
64#endif /* if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 27) || __GLIBC__ > 2 */
65
6166/* Allocate a new protection key, with the PKEY_DISABLE_* bits
6267 specified in ACCESS_RIGHTS. The protection key mask for the
6368 current thread is updated to match the access privilege for the new
......@@ -82,4 +87,4 @@ int pkey_mprotect (void *__addr, size_t __len, int __prot, int __pkey) __THROW;
8287
8388__END_DECLS
8489
85#endif /* __USE_GNU */
\ No newline at end of file
90#endif /* __USE_GNU */