Skip to content
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/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4198,6 +4198,14 @@ fn test_linux(target: &str) {
cfg.skip_const(move |constant| {
let name = constant.ident();

// FIXME(linux): Requires newer kernel headers than CI has. These uapi/linux/mount.h
// constants (OPEN_TREE_NAMESPACE landed in v7.0, FSCONFIG_CMD_CREATE_EXCL in v6.6)
// aren't defined by the headers CI builds against on several targets (notably the
// tier2 cross sysroots), so skip on every libc until CI catches up.
if name == "OPEN_TREE_NAMESPACE" || name == "FSCONFIG_CMD_CREATE_EXCL" {
return true;
}

// L4Re requires a min stack size of 64k; that isn't defined in uClibc, but
// somewhere in the core libraries. uClibc wants 16k, but that's not enough.
if l4re && name == "PTHREAD_STACK_MIN" {
Expand All @@ -4220,6 +4228,10 @@ fn test_linux(target: &str) {
|| name.starts_with("EPOLL")
|| name.starts_with("F_")
|| name.starts_with("FALLOC_FL_")
|| name.starts_with("FSCONFIG_")
|| name.starts_with("FSMOUNT_")
|| name.starts_with("FSOPEN_")
|| name.starts_with("FSPICK_")
|| name.starts_with("FUTEX2_")
|| name.starts_with("IFLA_")
|| name.starts_with("KEXEC_")
Expand Down Expand Up @@ -4561,6 +4573,7 @@ fn test_linux(target: &str) {

let c_enums = [
"can_state",
"fsconfig_command",
"membarrier_cmd",
"pid_type",
"proc_cn_event",
Expand Down
17 changes: 17 additions & 0 deletions libc-test/semver/linux.txt
Original file line number Diff line number Diff line change
Expand Up @@ -901,6 +901,21 @@ FIONCLEX
FIONREAD
FLUSHO
FOPEN_MAX
FSCONFIG_CMD_CREATE
FSCONFIG_CMD_CREATE_EXCL
FSCONFIG_CMD_RECONFIGURE
FSCONFIG_SET_BINARY
FSCONFIG_SET_FD
FSCONFIG_SET_FLAG
FSCONFIG_SET_PATH
FSCONFIG_SET_PATH_EMPTY
FSCONFIG_SET_STRING
FSMOUNT_CLOEXEC
FSOPEN_CLOEXEC
FSPICK_CLOEXEC
FSPICK_EMPTY_PATH
FSPICK_NO_AUTOMOUNT
FSPICK_SYMLINK_NOFOLLOW
FS_IOC32_GETFLAGS
FS_IOC32_GETVERSION
FS_IOC32_SETFLAGS
Expand Down Expand Up @@ -2205,6 +2220,7 @@ OFILL
OLCUC
OPEN_TREE_CLOEXEC
OPEN_TREE_CLONE
OPEN_TREE_NAMESPACE
O_ASYNC
O_DIRECT
O_DSYNC
Expand Down Expand Up @@ -4109,6 +4125,7 @@ freeifaddrs
freelocale
fremovexattr
freopen64
fsconfig_command
fseeko64
fsetpos64
fsetxattr
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 @@ -3106,8 +3106,32 @@ pub const IN_NONBLOCK: c_int = O_NONBLOCK;

// uapi/linux/mount.h
pub const OPEN_TREE_CLONE: c_uint = 0x01;
pub const OPEN_TREE_NAMESPACE: c_uint = 0x02;
pub const OPEN_TREE_CLOEXEC: c_uint = O_CLOEXEC as c_uint;

pub const FSOPEN_CLOEXEC: c_uint = 0x00000001;

pub const FSPICK_CLOEXEC: c_uint = 0x00000001;
pub const FSPICK_SYMLINK_NOFOLLOW: c_uint = 0x00000002;
pub const FSPICK_NO_AUTOMOUNT: c_uint = 0x00000004;
pub const FSPICK_EMPTY_PATH: c_uint = 0x00000008;

pub const FSMOUNT_CLOEXEC: c_uint = 0x00000001;

c_enum! {
pub enum fsconfig_command {
pub FSCONFIG_SET_FLAG,
pub FSCONFIG_SET_STRING,
pub FSCONFIG_SET_BINARY,
pub FSCONFIG_SET_PATH,
pub FSCONFIG_SET_PATH_EMPTY,
pub FSCONFIG_SET_FD,
pub FSCONFIG_CMD_CREATE,
pub FSCONFIG_CMD_RECONFIGURE,
pub FSCONFIG_CMD_CREATE_EXCL,
}
}

// uapi/linux/netfilter/nf_tables.h
pub const NFT_TABLE_MAXNAMELEN: c_int = 256;
pub const NFT_CHAIN_MAXNAMELEN: c_int = 256;
Expand Down