summaryrefslogtreecommitdiff
path: root/src/unix/linux_like
diff options
context:
space:
mode:
authorFanael Linithien <fanael4@gmail.com>2021-10-24 09:30:37 +0200
committerFanael Linithien <fanael4@gmail.com>2021-11-04 16:29:19 +0100
commit93e85a35c8750f960080c9fe59731684595d9455 (patch)
tree3faa4ebee328e00937146f14769eecf755f1a921 /src/unix/linux_like
parent072d6de366123d32cf7c7b76aa6e37ce5a306404 (diff)
downloadrust-libc-93e85a35c8750f960080c9fe59731684595d9455.tar.gz
linux: Add open_how and related flags
Diffstat (limited to 'src/unix/linux_like')
-rw-r--r--src/unix/linux_like/linux/mod.rs15
-rw-r--r--src/unix/linux_like/linux/non_exhaustive.rs9
2 files changed, 24 insertions, 0 deletions
diff --git a/src/unix/linux_like/linux/mod.rs b/src/unix/linux_like/linux/mod.rs
index 6353ecf8b6..141dbef22b 100644
--- a/src/unix/linux_like/linux/mod.rs
+++ b/src/unix/linux_like/linux/mod.rs
@@ -1824,6 +1824,14 @@ pub const MFD_HUGETLB: ::c_uint = 0x0004;
pub const CLOSE_RANGE_UNSHARE: ::c_uint = 1 << 1;
pub const CLOSE_RANGE_CLOEXEC: ::c_uint = 1 << 2;
+// linux/openat2.h
+pub const RESOLVE_NO_XDEV: ::__u64 = 0x01;
+pub const RESOLVE_NO_MAGICLINKS: ::__u64 = 0x02;
+pub const RESOLVE_NO_SYMLINKS: ::__u64 = 0x04;
+pub const RESOLVE_BENEATH: ::__u64 = 0x08;
+pub const RESOLVE_IN_ROOT: ::__u64 = 0x10;
+pub const RESOLVE_CACHED: ::__u64 = 0x20;
+
// these are used in the p_type field of Elf32_Phdr and Elf64_Phdr, which has
// the type Elf32Word and Elf64Word respectively. Luckily, both of those are u32
// so we can use that type here to avoid having to cast.
@@ -3942,3 +3950,10 @@ cfg_if! {
}
}
expand_align!();
+
+cfg_if! {
+ if #[cfg(libc_non_exhaustive)] {
+ mod non_exhaustive;
+ pub use self::non_exhaustive::*;
+ }
+}
diff --git a/src/unix/linux_like/linux/non_exhaustive.rs b/src/unix/linux_like/linux/non_exhaustive.rs
new file mode 100644
index 0000000000..e2e2cb847a
--- /dev/null
+++ b/src/unix/linux_like/linux/non_exhaustive.rs
@@ -0,0 +1,9 @@
+s! {
+ // linux/openat2.h
+ #[non_exhaustive]
+ pub struct open_how {
+ pub flags: ::__u64,
+ pub mode: ::__u64,
+ pub resolve: ::__u64,
+ }
+}