Skip to content

Commit 7798f03

Browse files
authored
libc: add MS_NOSYMFOLLOW support (#1471)
Linux platforms that are forced to use the libc backend cannot access MS_NOSYMFOLLOW. The upstream libc crate doesn't expose MS_NOSYMFOLLOW, but on Linux we can just remap linux-raw-sys. FreeBSD also has nosymfollow support in the form of MNT_NOSYMFOLLOW, but rustix::mount is not provided for FreeBSD. Signed-off-by: Aleksa Sarai <[email protected]>
1 parent 3ff59d4 commit 7798f03

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

src/backend/libc/c.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ pub(crate) const ETH_P_XDSA: c_int = linux_raw_sys::if_ether::ETH_P_XDSA as _;
6363
pub(crate) const ETH_P_MAP: c_int = linux_raw_sys::if_ether::ETH_P_MAP as _;
6464
#[cfg(all(linux_raw_dep, feature = "net"))]
6565
pub(crate) const ETH_P_MCTP: c_int = linux_raw_sys::if_ether::ETH_P_MCTP as _;
66+
#[cfg(all(linux_kernel, feature = "mount"))]
67+
pub(crate) const MS_NOSYMFOLLOW: c_ulong = linux_raw_sys::general::MS_NOSYMFOLLOW as _;
6668

6769
#[cfg(all(
6870
linux_kernel,

src/backend/libc/mount/types.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ bitflags! {
5656
/// `MS_SYNCHRONOUS`
5757
const SYNCHRONOUS = c::MS_SYNCHRONOUS;
5858

59+
/// `MS_NOSYMFOLLOW`
60+
const NOSYMFOLLOW = c::MS_NOSYMFOLLOW;
61+
5962
/// <https://docs.rs/bitflags/*/bitflags/#externally-defined-flags>
6063
const _ = !0;
6164
}

0 commit comments

Comments
 (0)