Skip to content

Commit

Permalink
Add struct and constants for mount_setattr syscall
Browse files Browse the repository at this point in the history
(backport <rust-lang#4046>)
(cherry picked from commit d691ee7)
  • Loading branch information
pcc authored and tgross35 committed Nov 25, 2024
1 parent 34931d6 commit a2e24e4
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 @@ -3819,6 +3831,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 @@ -1217,6 +1217,15 @@ s! {
pub csum_start: ::__u16,
pub csum_offset: ::__u16,
}

// 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 @@ -5675,6 +5684,21 @@ pub const XDP_TXMD_FLAGS_CHECKSUM: ::__u32 = 1 << 1;

pub const XDP_TX_METADATA: ::__u32 = 1 << 1;

// 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 a2e24e4

Please sign in to comment.