Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add struct and constants for mount_setattr syscall #4046

Merged
merged 1 commit into from
Nov 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -3818,6 +3830,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 @@ -5635,6 +5644,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