mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-29 11:41:21 +03:00
Implement the mlock2 function
Fallback using mlock is provided if the flags argument is zero. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
This commit is contained in:
@ -28,12 +28,21 @@
|
||||
# define MFD_HUGETLB 4U
|
||||
# endif
|
||||
|
||||
/* Flags for mlock2. */
|
||||
# ifndef MLOCK_ONFAULT
|
||||
# define MLOCK_ONFAULT 1U
|
||||
# endif
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* 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;
|
||||
|
||||
/* Lock pages from ADDR (inclusive) to ADDR + LENGTH (exclusive) into
|
||||
memory. FLAGS is a combination of the MLOCK_* flags above. */
|
||||
int mlock2 (const void *__addr, size_t __length, unsigned int __flags) __THROW;
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* __USE_GNU */
|
||||
|
Reference in New Issue
Block a user