Skip to content

Commit 95ab2d7

Browse files
committed
Add statx function and constants specific to it
1 parent 027d483 commit 95ab2d7

File tree

1 file changed

+55
-0
lines changed
  • src/unix/notbsd/linux/other

1 file changed

+55
-0
lines changed

src/unix/notbsd/linux/other/mod.rs

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,33 @@ s! {
242242
pub rt_window: ::c_ulong,
243243
pub rt_irtt: ::c_ushort,
244244
}
245+
246+
pub struct statx {
247+
pub stx_mask: ::__u32,
248+
pub stx_blksize: ::__u32,
249+
pub stx_attributes: ::__u64,
250+
pub stx_nlink: ::__u32,
251+
pub stx_uid: ::__u32,
252+
pub stx_gid: ::__u32,
253+
pub stx_mode: ::__u16,
254+
pub stx_ino: ::__u16,
255+
pub stx_size: ::__u64,
256+
pub stx_blocks: ::__u64,
257+
pub stx_attributes_mask: ::__u64,
258+
pub stx_atime: statx_timestamp,
259+
pub stx_btime: statx_timestamp,
260+
pub stx_ctime: statx_timestamp,
261+
pub stx_mtime: statx_timestamp,
262+
pub stx_rdev_major: ::__u32,
263+
pub stx_rdev_minor: ::__u32,
264+
pub stx_dev_major: ::__u32,
265+
pub stx_dev_minor: ::__u32,
266+
}
267+
268+
pub struct statx_timestamp {
269+
pub tv_sec: ::int64_t,
270+
pub tv_nsec: ::__u32,
271+
}
245272
}
246273

247274
pub const __UT_LINESIZE: usize = 32;
@@ -837,6 +864,32 @@ pub const M_PERTURB: ::c_int = -6;
837864
pub const M_ARENA_TEST: ::c_int = -7;
838865
pub const M_ARENA_MAX: ::c_int = -8;
839866

867+
pub const AT_STATX_SYNC_TYPE: ::c_int = 0x6000;
868+
pub const AT_STATX_SYNC_AS_STAT: ::c_int = 0x0000;
869+
pub const AT_STATX_FORCE_SYNC: ::c_int = 0x2000;
870+
pub const AT_STATX_DONT_SYNC: ::c_int = 0x4000;
871+
pub const STATX_TYPE: ::c_uint = 0x0001;
872+
pub const STATX_MODE: ::c_uint = 0x0002;
873+
pub const STATX_NLINK: ::c_uint = 0x0004;
874+
pub const STATX_UID: ::c_uint = 0x0008;
875+
pub const STATX_GID: ::c_uint = 0x0010;
876+
pub const STATX_ATIME: ::c_uint = 0x0020;
877+
pub const STATX_MTIME: ::c_uint = 0x0040;
878+
pub const STATX_CTIME: ::c_uint = 0x0080;
879+
pub const STATX_INO: ::c_uint = 0x0100;
880+
pub const STATX_SIZE: ::c_uint = 0x0200;
881+
pub const STATX_BLOCKS: ::c_uint = 0x0400;
882+
pub const STATX_BASIC_STATS: ::c_uint = 0x07ff;
883+
pub const STATX_BTIME: ::c_uint = 0x0800;
884+
pub const STATX_ALL: ::c_uint = 0x0fff;
885+
pub const STATX__RESERVED: ::c_int = 0x80000000;
886+
pub const STATX_ATTR_COMPRESSED: ::c_int = 0x0004;
887+
pub const STATX_ATTR_IMMUTABLE: ::c_int = 0x0010;
888+
pub const STATX_ATTR_APPEND: ::c_int = 0x0020;
889+
pub const STATX_ATTR_NODUMP: ::c_int = 0x0040;
890+
pub const STATX_ATTR_ENCRYPTED: ::c_int = 0x0800;
891+
pub const STATX_ATTR_AUTOMOUNT: ::c_int = 0x1000;
892+
840893
#[doc(hidden)]
841894
pub const AF_MAX: ::c_int = 42;
842895
#[doc(hidden)]
@@ -870,6 +923,8 @@ extern {
870923
pub fn endutxent();
871924
pub fn getpt() -> ::c_int;
872925
pub fn mallopt(param: ::c_int, value: ::c_int) -> ::c_int;
926+
pub fn statx(dirfd: ::c_int, pathname: *const c_char, flags: ::c_int,
927+
mask: ::c_uint, statxbuf: *mut statx) -> ::c_int;
873928
}
874929

875930
#[link(name = "util")]

0 commit comments

Comments
 (0)