Skip to content

Commit

Permalink
Add struct and constants for mount_setattr syscall
Browse files Browse the repository at this point in the history
  • Loading branch information
pcc committed Nov 15, 2024
1 parent 3a0b044 commit 44b1782
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
13 changes: 13 additions & 0 deletions libc-test/semver/linux.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1661,6 +1661,18 @@ MON_6
MON_7
MON_8
MON_9
MOUNT_ATTR_IDMAP
MOUNT_ATTR_NOATIME
MOUNT_ATTR_NODEV
MOUNT_ATTR_NODIRATIME
MOUNT_ATTR_NOEXEC
MOUNT_ATTR_NOSUID
MOUNT_ATTR_NOSYMFOLLOW
MOUNT_ATTR_RDONLY
MOUNT_ATTR_RELATIME
MOUNT_ATTR_SIZE_VER0
MOUNT_ATTR_STRICTATIME
MOUNT_ATTR__ATIME
MREMAP_FIXED
MREMAP_MAYMOVE
MSC_CNT
Expand Down Expand Up @@ -3787,6 +3799,7 @@ mmap64
mmsghdr
mntent
mount
mount_attr
mq_attr
mq_close
mq_getattr
Expand Down
24 changes: 24 additions & 0 deletions src/unix/linux_like/linux/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1045,6 +1045,15 @@ s! {
pub prefer_busy_poll: u8,
pub __pad: u8, // Must be zero
}

// linux/mount.h

pub struct mount_attr {
pub attr_set: ::__u64,
pub attr_clr: ::__u64,
pub propagation: ::__u64,
pub userns_fd: ::__u64,
}
}

cfg_if! {
Expand Down Expand Up @@ -5190,6 +5199,21 @@ pub const SCHED_FLAG_KEEP_PARAMS: ::c_int = 0x10;
pub const SCHED_FLAG_UTIL_CLAMP_MIN: ::c_int = 0x20;
pub const SCHED_FLAG_UTIL_CLAMP_MAX: ::c_int = 0x40;

// linux/mount.h
pub const MOUNT_ATTR_RDONLY: ::__u64 = 0x00000001;
pub const MOUNT_ATTR_NOSUID: ::__u64 = 0x00000002;
pub const MOUNT_ATTR_NODEV: ::__u64 = 0x00000004;
pub const MOUNT_ATTR_NOEXEC: ::__u64 = 0x00000008;
pub const MOUNT_ATTR__ATIME: ::__u64 = 0x00000070;
pub const MOUNT_ATTR_RELATIME: ::__u64 = 0x00000000;
pub const MOUNT_ATTR_NOATIME: ::__u64 = 0x00000010;
pub const MOUNT_ATTR_STRICTATIME: ::__u64 = 0x00000020;
pub const MOUNT_ATTR_NODIRATIME: ::__u64 = 0x00000080;
pub const MOUNT_ATTR_IDMAP: ::__u64 = 0x00100000;
pub const MOUNT_ATTR_NOSYMFOLLOW: ::__u64 = 0x00200000;

pub const MOUNT_ATTR_SIZE_VER0: ::c_int = 32;

// elf.h
pub const NT_PRSTATUS: ::c_int = 1;
pub const NT_PRFPREG: ::c_int = 2;
Expand Down

0 comments on commit 44b1782

Please sign in to comment.