Skip to content

Commit 60366ea

Browse files
authored
Add a DROPPABLE flag to MapFlags. (#1123)
Fixes #1096.
1 parent a0d6f3a commit 60366ea

File tree

4 files changed

+12
-0
lines changed

4 files changed

+12
-0
lines changed

src/backend/libc/c.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,10 @@ pub(crate) const O_LARGEFILE: c_int = linux_raw_sys::general::O_LARGEFILE as _;
9696
#[cfg(target_os = "illumos")]
9797
pub(crate) const O_LARGEFILE: c_int = 0x2000;
9898

99+
// TODO: This is new in Linux 6.11; remove when linux-raw-sys is updated.
100+
#[cfg(linux_kernel)]
101+
pub(crate) const MAP_DROPPABLE: u32 = 0x8;
102+
99103
// On PowerPC, the regular `termios` has the `termios2` fields and there is no
100104
// `termios2`. linux-raw-sys has aliases `termios2` to `termios` to cover this
101105
// difference, but we still need to manually import it since `libc` doesn't

src/backend/libc/mm/types.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,9 @@ bitflags! {
240240
/// `MAP_UNINITIALIZED`
241241
#[cfg(any())]
242242
const UNINITIALIZED = bitcast!(c::MAP_UNINITIALIZED);
243+
/// `MAP_DROPPABLE`
244+
#[cfg(linux_kernel)]
245+
const DROPPABLE = bitcast!(c::MAP_DROPPABLE);
243246

244247
/// <https://docs.rs/bitflags/*/bitflags/#externally-defined-flags>
245248
const _ = !0;

src/backend/linux_raw/c.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,3 +317,6 @@ mod reboot_symbols {
317317
}
318318
#[cfg(feature = "system")]
319319
pub(crate) use reboot_symbols::*;
320+
321+
// TODO: This is new in Linux 6.11; remove when linux-raw-sys is updated.
322+
pub(crate) const MAP_DROPPABLE: u32 = 0x8;

src/backend/linux_raw/mm/types.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,8 @@ bitflags! {
105105
/// `MAP_UNINITIALIZED`
106106
#[cfg(not(any(target_arch = "mips", target_arch = "mips32r6", target_arch = "mips64", target_arch = "mips64r6")))]
107107
const UNINITIALIZED = linux_raw_sys::general::MAP_UNINITIALIZED;
108+
/// `MAP_DROPPABLE`
109+
const DROPPABLE = c::MAP_DROPPABLE;
108110

109111
/// <https://docs.rs/bitflags/*/bitflags/#externally-defined-flags>
110112
const _ = !0;

0 commit comments

Comments
 (0)