From 88e41099388e7619d029f41a673bccdff36f454d Mon Sep 17 00:00:00 2001 From: Thomas de Zeeuw Date: Mon, 12 Jan 2026 22:20:04 +0100 Subject: [PATCH] Add MADV_ZERO for macOS --- libc-test/semver/apple.txt | 1 + src/unix/bsd/apple/mod.rs | 1 + 2 files changed, 2 insertions(+) diff --git a/libc-test/semver/apple.txt b/libc-test/semver/apple.txt index 3bc827f8d849c..7b11ad7c66ebd 100644 --- a/libc-test/semver/apple.txt +++ b/libc-test/semver/apple.txt @@ -872,6 +872,7 @@ MADV_NORMAL MADV_RANDOM MADV_SEQUENTIAL MADV_WILLNEED +MADV_ZERO MADV_ZERO_WIRED_PAGES MAP_COPY MAP_FILE diff --git a/src/unix/bsd/apple/mod.rs b/src/unix/bsd/apple/mod.rs index 7b084251d3b8e..ec1df99ca1d9f 100644 --- a/src/unix/bsd/apple/mod.rs +++ b/src/unix/bsd/apple/mod.rs @@ -2340,6 +2340,7 @@ pub const MADV_ZERO_WIRED_PAGES: c_int = 6; pub const MADV_FREE_REUSABLE: c_int = 7; pub const MADV_FREE_REUSE: c_int = 8; pub const MADV_CAN_REUSE: c_int = 9; +pub const MADV_ZERO: c_int = 11; pub const MINCORE_INCORE: c_int = 0x1; pub const MINCORE_REFERENCED: c_int = 0x2;