From a3ca238655ccb156812e4db39d1997471df1f5d8 Mon Sep 17 00:00:00 2001 From: David Carlier Date: Wed, 23 Oct 2024 06:38:45 +0100 Subject: [PATCH] freebsd adding CLOSE_RANGE_CLOEXEC flag (backport ) (cherry picked from commit 0fb363c62aed39b2b8663dc2ae91a89daa6ae37e) --- libc-test/semver/freebsd.txt | 1 + src/unix/bsd/freebsdlike/freebsd/mod.rs | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/libc-test/semver/freebsd.txt b/libc-test/semver/freebsd.txt index e3418ef7d220e..096133a059520 100644 --- a/libc-test/semver/freebsd.txt +++ b/libc-test/semver/freebsd.txt @@ -264,6 +264,7 @@ CLOCK_UPTIME CLOCK_UPTIME_FAST CLOCK_UPTIME_PRECISE CLOCK_VIRTUAL +CLOSE_RANGE_CLOEXEC CMGROUP_MAX CMSG_DATA CMSG_FIRSTHDR diff --git a/src/unix/bsd/freebsdlike/freebsd/mod.rs b/src/unix/bsd/freebsdlike/freebsd/mod.rs index 56ceabe6aacb8..7e8d6486d7981 100644 --- a/src/unix/bsd/freebsdlike/freebsd/mod.rs +++ b/src/unix/bsd/freebsdlike/freebsd/mod.rs @@ -4968,6 +4968,10 @@ pub const TFD_CLOEXEC: ::c_int = O_CLOEXEC; pub const TFD_TIMER_ABSTIME: ::c_int = 0x01; pub const TFD_TIMER_CANCEL_ON_SET: ::c_int = 0x02; +// sys/unistd.h + +pub const CLOSE_RANGE_CLOEXEC: ::c_uint = 1 << 2; + cfg_if! { if #[cfg(libc_const_extern_fn)] { pub const fn MAP_ALIGNED(a: ::c_int) -> ::c_int {