Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

generic glibc: guard memfd_create & mlock2 declarations #22801

Merged
merged 1 commit into from
Feb 8, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion lib/libc/include/generic-glibc/bits/mman-shared.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@

__BEGIN_DECLS

// zig patch: check target glibc version
# if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 27) || __GLIBC__ > 2

/* Create a new memory file descriptor. NAME is a name for debugging.
FLAGS is a combination of the MFD_* constants. */
int memfd_create (const char *__name, unsigned int __flags) __THROW;
Expand All @@ -58,6 +61,8 @@ int memfd_create (const char *__name, unsigned int __flags) __THROW;
memory. FLAGS is a combination of the MLOCK_* flags above. */
int mlock2 (const void *__addr, size_t __length, unsigned int __flags) __THROW;

#endif /* if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 27) || __GLIBC__ > 2 */

/* Allocate a new protection key, with the PKEY_DISABLE_* bits
specified in ACCESS_RIGHTS. The protection key mask for the
current thread is updated to match the access privilege for the new
Expand All @@ -82,4 +87,4 @@ int pkey_mprotect (void *__addr, size_t __len, int __prot, int __pkey) __THROW;

__END_DECLS

#endif /* __USE_GNU */
#endif /* __USE_GNU */
Loading