Skip to content

Commit 68ad935

Browse files
committed
Auto merge of #3048 - lucab:ups/linux-open-tree-flags, r=JohnTitor
linux-like: add OPEN_TREE_CLONE and OPEN_TREE_CLOEXEC This adds the `OPEN_TREE_CLONE` and `OPEN_TREE_CLOEXEC` constants on Linux and Android. Those are used by the `open_tree()` syscall and defined in `mount.h`: * https://github.com/torvalds/linux/blob/v6.1/include/uapi/linux/mount.h#L61-L65
2 parents d1edf0c + 82ded69 commit 68ad935

File tree

5 files changed

+16
-0
lines changed

5 files changed

+16
-0
lines changed

libc-test/build.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1621,6 +1621,7 @@ fn test_android(target: &str) {
16211621
"linux/memfd.h",
16221622
"linux/mempolicy.h",
16231623
"linux/module.h",
1624+
"linux/mount.h",
16241625
"linux/net_tstamp.h",
16251626
"linux/netfilter/nfnetlink.h",
16261627
"linux/netfilter/nfnetlink_log.h",
@@ -3197,6 +3198,8 @@ fn test_linux(target: &str) {
31973198
"linux/mempolicy.h",
31983199
"linux/mman.h",
31993200
"linux/module.h",
3201+
// FIXME: requires kernel headers >= 5.1.
3202+
[!musl]: "linux/mount.h",
32003203
"linux/net_tstamp.h",
32013204
"linux/netfilter/nfnetlink.h",
32023205
"linux/netfilter/nfnetlink_log.h",
@@ -3402,6 +3405,7 @@ fn test_linux(target: &str) {
34023405
|| name.starts_with("IFLA_")
34033406
|| name.starts_with("MS_")
34043407
|| name.starts_with("MSG_")
3408+
|| name.starts_with("OPEN_TREE_")
34053409
|| name.starts_with("P_")
34063410
|| name.starts_with("PF_")
34073411
|| name.starts_with("RLIMIT_")

libc-test/semver/android.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1648,6 +1648,8 @@ ONLCR
16481648
ONLRET
16491649
ONOCR
16501650
OPENPROM_SUPER_MAGIC
1651+
OPEN_TREE_CLOEXEC
1652+
OPEN_TREE_CLONE
16511653
OPOST
16521654
O_ACCMODE
16531655
O_APPEND

libc-test/semver/linux.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1618,6 +1618,8 @@ NUD_STALE
16181618
OFDEL
16191619
OFILL
16201620
OLCUC
1621+
OPEN_TREE_CLOEXEC
1622+
OPEN_TREE_CLONE
16211623
O_ASYNC
16221624
O_DIRECT
16231625
O_DSYNC

src/unix/linux_like/android/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2121,6 +2121,10 @@ pub const PT_HIOS: u32 = 0x6fffffff;
21212121
pub const PT_LOPROC: u32 = 0x70000000;
21222122
pub const PT_HIPROC: u32 = 0x7fffffff;
21232123

2124+
// uapi/linux/mount.h
2125+
pub const OPEN_TREE_CLONE: ::c_uint = 0x01;
2126+
pub const OPEN_TREE_CLOEXEC: ::c_uint = O_CLOEXEC as ::c_uint;
2127+
21242128
// linux/netfilter.h
21252129
pub const NF_DROP: ::c_int = 0;
21262130
pub const NF_ACCEPT: ::c_int = 1;

src/unix/linux_like/linux/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3142,6 +3142,10 @@ pub const IN_ALL_EVENTS: u32 = IN_ACCESS
31423142
pub const IN_CLOEXEC: ::c_int = O_CLOEXEC;
31433143
pub const IN_NONBLOCK: ::c_int = O_NONBLOCK;
31443144

3145+
// uapi/linux/mount.h
3146+
pub const OPEN_TREE_CLONE: ::c_uint = 0x01;
3147+
pub const OPEN_TREE_CLOEXEC: ::c_uint = O_CLOEXEC as ::c_uint;
3148+
31453149
// uapi/linux/netfilter/nf_tables.h
31463150
pub const NFT_TABLE_MAXNAMELEN: ::c_int = 256;
31473151
pub const NFT_CHAIN_MAXNAMELEN: ::c_int = 256;

0 commit comments

Comments
 (0)