diff options
Diffstat (limited to 'vendor/rustix/src/backend/libc/mm/types.rs')
-rw-r--r-- | vendor/rustix/src/backend/libc/mm/types.rs | 35 |
1 files changed, 22 insertions, 13 deletions
diff --git a/vendor/rustix/src/backend/libc/mm/types.rs b/vendor/rustix/src/backend/libc/mm/types.rs index ef335d27a..a4aa3e232 100644 --- a/vendor/rustix/src/backend/libc/mm/types.rs +++ b/vendor/rustix/src/backend/libc/mm/types.rs @@ -6,7 +6,7 @@ bitflags! { /// /// For `PROT_NONE`, use `ProtFlags::empty()`. /// - /// [`mmap`]: crate::io::mmap + /// [`mmap`]: crate::mm::mmap #[repr(transparent)] #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)] pub struct ProtFlags: u32 { @@ -27,7 +27,7 @@ bitflags! { /// /// For `PROT_NONE`, use `MprotectFlags::empty()`. /// - /// [`mprotect`]: crate::io::mprotect + /// [`mprotect`]: crate::mm::mprotect #[repr(transparent)] #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)] pub struct MprotectFlags: u32 { @@ -69,8 +69,8 @@ bitflags! { /// /// For `MAP_ANONYMOUS` (aka `MAP_ANON`), see [`mmap_anonymous`]. /// - /// [`mmap`]: crate::io::mmap - /// [`mmap_anonymous`]: crates::io::mmap_anonymous + /// [`mmap`]: crate::mm::mmap + /// [`mmap_anonymous`]: crates::mm::mmap_anonymous #[repr(transparent)] #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)] pub struct MapFlags: u32 { @@ -242,8 +242,8 @@ bitflags! { /// /// For `MREMAP_FIXED`, see [`mremap_fixed`]. /// - /// [`mremap`]: crate::io::mremap - /// [`mremap_fixed`]: crate::io::mremap_fixed + /// [`mremap`]: crate::mm::mremap + /// [`mremap_fixed`]: crate::mm::mremap_fixed #[repr(transparent)] #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)] pub struct MremapFlags: u32 { @@ -258,7 +258,7 @@ bitflags! { bitflags! { /// `MS_*` flags for use with [`msync`]. /// - /// [`msync`]: crate::io::msync + /// [`msync`]: crate::mm::msync #[repr(transparent)] #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)] pub struct MsyncFlags: u32 { @@ -281,7 +281,7 @@ bitflags! { bitflags! { /// `MLOCK_*` flags for use with [`mlock_with`]. /// - /// [`mlock_with`]: crate::io::mlock_with + /// [`mlock_with`]: crate::mm::mlock_with #[repr(transparent)] #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)] pub struct MlockFlags: u32 { @@ -383,10 +383,10 @@ pub enum Advice { /// `MADV_UNMERGEABLE` #[cfg(linux_kernel)] LinuxUnmergeable = bitcast!(c::MADV_UNMERGEABLE), - /// `MADV_HUGEPAGE` (since Linux 2.6.38) + /// `MADV_HUGEPAGE` #[cfg(linux_kernel)] LinuxHugepage = bitcast!(c::MADV_HUGEPAGE), - /// `MADV_NOHUGEPAGE` (since Linux 2.6.38) + /// `MADV_NOHUGEPAGE` #[cfg(linux_kernel)] LinuxNoHugepage = bitcast!(c::MADV_NOHUGEPAGE), /// `MADV_DONTDUMP` (since Linux 3.4) @@ -429,7 +429,7 @@ impl Advice { bitflags! { /// `O_*` flags for use with [`userfaultfd`]. /// - /// [`userfaultfd`]: crate::io::userfaultfd + /// [`userfaultfd`]: crate::mm::userfaultfd #[repr(transparent)] #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)] pub struct UserfaultfdFlags: u32 { @@ -451,8 +451,17 @@ bitflags! { #[repr(transparent)] #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)] pub struct MlockAllFlags: u32 { - // libc doesn't define `MCL_ONFAULT` yet. - // const ONFAULT = libc::MCL_ONFAULT; + /// Used together with `MCL_CURRENT`, `MCL_FUTURE`, or both. Mark all + /// current (with `MCL_CURRENT`) or future (with `MCL_FUTURE`) mappings + /// to lock pages when they are faulted in. When used with + /// `MCL_CURRENT`, all present pages are locked, but `mlockall` will + /// not fault in non-present pages. When used with `MCL_FUTURE`, all + /// future mappings will be marked to lock pages when they are faulted + /// in, but they will not be populated by the lock when the mapping is + /// created. `MCL_ONFAULT` must be used with either `MCL_CURRENT` or + /// `MCL_FUTURE` or both. + #[cfg(linux_kernel)] + const ONFAULT = bitcast!(libc::MCL_ONFAULT); /// Lock all pages which will become mapped into the address space of /// the process in the future. These could be, for instance, new pages /// required by a growing heap and stack as well as new memory-mapped |