Skip to content

Commit

Permalink
adding MOVE_MOUNT* constants for linux to use with SYS_move_mount
Browse files Browse the repository at this point in the history
syscall.

close #3387
  • Loading branch information
devnexen committed Oct 17, 2023
1 parent df3f7c1 commit f105c14
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
3 changes: 3 additions & 0 deletions libc-test/build.rs
Expand Up @@ -3862,6 +3862,9 @@ fn test_linux(target: &str) {
// FIXME: Requires more recent kernel headers
"HWTSTAMP_TX_ONESTEP_P2P" if musl => true, // linux v5.6+

// kernel 6.5 minimum
"MOVE_MOUNT_BENEATH" => true,

_ => false,
}
});
Expand Down
9 changes: 9 additions & 0 deletions libc-test/semver/linux-gnu.txt
Expand Up @@ -140,6 +140,15 @@ MOD_OFFSET
MOD_STATUS
MOD_TAI
MOD_TIMECONST
MOVE_MOUNT__MASK
MOVE_MOUNT_BENEATH
MOVE_MOUNT_F_AUTOMOUNTS
MOVE_MOUNT_F_EMPTY_PATH
MOVE_MOUNT_F_SYMLINKS
MOVE_MOUNT_SET_GROUP
MOVE_MOUNT_T_AUTOMOUNTS
MOVE_MOUNT_T_EMPTY_PATH
MOVE_MOUNT_T_SYMLINKS
MPOL_BIND
MPOL_DEFAULT
MPOL_F_NUMA_BALANCING
Expand Down
13 changes: 12 additions & 1 deletion src/unix/linux_like/linux/gnu/mod.rs
Expand Up @@ -1029,7 +1029,18 @@ pub const STATX_ATTR_DAX: ::c_int = 0x00200000;

pub const SOMAXCONN: ::c_int = 4096;

//sys/timex.h
// linux/mount.h
pub const MOVE_MOUNT_F_SYMLINKS: ::c_uint = 0x00000001;
pub const MOVE_MOUNT_F_AUTOMOUNTS: ::c_uint = 0x00000002;
pub const MOVE_MOUNT_F_EMPTY_PATH: ::c_uint = 0x00000004;
pub const MOVE_MOUNT_T_SYMLINKS: ::c_uint = 0x00000010;
pub const MOVE_MOUNT_T_AUTOMOUNTS: ::c_uint = 0x00000020;
pub const MOVE_MOUNT_T_EMPTY_PATH: ::c_uint = 0x00000040;
pub const MOVE_MOUNT_SET_GROUP: ::c_uint = 0x00000100;
pub const MOVE_MOUNT_BENEATH: ::c_uint = 0x00000200;
pub const MOVE_MOUNT__MASK: ::c_uint = 0x00000377;

// sys/timex.h
pub const ADJ_OFFSET: ::c_uint = 0x0001;
pub const ADJ_FREQUENCY: ::c_uint = 0x0002;
pub const ADJ_MAXERROR: ::c_uint = 0x0004;
Expand Down

0 comments on commit f105c14

Please sign in to comment.