Skip to content

Commit adc34ee

Browse files
committed
Add AdviseFlag variants for FreeBSD
1 parent 53190fa commit adc34ee

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

src/mem.rs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,26 @@ new_flag!(
108108
#[cfg(any(target_os = "ios", target_os = "macos", target_os = "tvos", target_os = "visionos", target_os = "watchos"))]
109109
ZERO = libc::MADV_ZERO,
110110
*/
111+
/// Don't flush the data associated with this map to physical backing
112+
/// store unless it needs to.
113+
#[cfg(target_os = "freebsd")]
114+
NO_SYNC = libc::MADV_NOSYNC,
115+
/// Undoes the effects of [`AdviseFlag::NO_SYNC`] for any future pages
116+
/// dirtied within the address range.
117+
#[cfg(target_os = "freebsd")]
118+
AUTO_SYNC = libc::MADV_AUTOSYNC,
119+
/// Region is not included in a core file.
120+
#[cfg(target_os = "freebsd")]
121+
NO_CORE = libc::MADV_NOCORE,
122+
/// Include region in a core file.
123+
#[cfg(target_os = "freebsd")]
124+
CORE = libc::MADV_CORE,
125+
/// Informs the VM system this process should not be killed when the
126+
/// swap space is exhausted. The process must have superuser privileges.
127+
/// This should be used judiciously in processes that must remain
128+
/// running for the system to properly function.
129+
#[cfg(target_os = "freebsd")]
130+
PROTECT = libc::MADV_PROTECT,
111131
}
112132
);
113133

0 commit comments

Comments
 (0)