@@ -205,6 +205,45 @@ s! {
205205 }
206206}
207207
208+ cfg_if ! {
209+ if #[ cfg( any( target_env = "gnu" , target_os = "android" ) ) ] {
210+ s! {
211+ pub struct statx {
212+ pub stx_mask: :: __u32,
213+ pub stx_blksize: :: __u32,
214+ pub stx_attributes: :: __u64,
215+ pub stx_nlink: :: __u32,
216+ pub stx_uid: :: __u32,
217+ pub stx_gid: :: __u32,
218+ pub stx_mode: :: __u16,
219+ __statx_pad1: [ :: __u16; 1 ] ,
220+ pub stx_ino: :: __u64,
221+ pub stx_size: :: __u64,
222+ pub stx_blocks: :: __u64,
223+ pub stx_attributes_mask: :: __u64,
224+ pub stx_atime: statx_timestamp,
225+ pub stx_btime: statx_timestamp,
226+ pub stx_ctime: statx_timestamp,
227+ pub stx_mtime: statx_timestamp,
228+ pub stx_rdev_major: :: __u32,
229+ pub stx_rdev_minor: :: __u32,
230+ pub stx_dev_major: :: __u32,
231+ pub stx_dev_minor: :: __u32,
232+ pub stx_mnt_id: :: __u64,
233+ pub stx_dio_mem_align: :: __u32,
234+ pub stx_dio_offset_align: :: __u32,
235+ __statx_pad3: [ :: __u64; 12 ] ,
236+ }
237+
238+ pub struct statx_timestamp {
239+ pub tv_sec: :: __s64,
240+ pub tv_nsec: :: __u32,
241+ __statx_timestamp_pad1: [ :: __s32; 1 ] ,
242+ }
243+ }
244+ }
245+ }
246+
208247s_no_extra_traits ! {
209248 #[ cfg_attr(
210249 any(
@@ -1529,6 +1568,41 @@ cfg_if! {
15291568 }
15301569}
15311570
1571+ cfg_if ! {
1572+ if #[ cfg( any( target_env = "gnu" , target_os = "android" ) ) ] {
1573+ pub const AT_STATX_SYNC_TYPE : :: c_int = 0x6000 ;
1574+ pub const AT_STATX_SYNC_AS_STAT : :: c_int = 0x0000 ;
1575+ pub const AT_STATX_FORCE_SYNC : :: c_int = 0x2000 ;
1576+ pub const AT_STATX_DONT_SYNC : :: c_int = 0x4000 ;
1577+ pub const STATX_TYPE : :: c_uint = 0x0001 ;
1578+ pub const STATX_MODE : :: c_uint = 0x0002 ;
1579+ pub const STATX_NLINK : :: c_uint = 0x0004 ;
1580+ pub const STATX_UID : :: c_uint = 0x0008 ;
1581+ pub const STATX_GID : :: c_uint = 0x0010 ;
1582+ pub const STATX_ATIME : :: c_uint = 0x0020 ;
1583+ pub const STATX_MTIME : :: c_uint = 0x0040 ;
1584+ pub const STATX_CTIME : :: c_uint = 0x0080 ;
1585+ pub const STATX_INO : :: c_uint = 0x0100 ;
1586+ pub const STATX_SIZE : :: c_uint = 0x0200 ;
1587+ pub const STATX_BLOCKS : :: c_uint = 0x0400 ;
1588+ pub const STATX_BASIC_STATS : :: c_uint = 0x07ff ;
1589+ pub const STATX_BTIME : :: c_uint = 0x0800 ;
1590+ pub const STATX_ALL : :: c_uint = 0x0fff ;
1591+ pub const STATX_MNT_ID : :: c_uint = 0x1000 ;
1592+ pub const STATX_DIOALIGN : :: c_uint = 0x2000 ;
1593+ pub const STATX__RESERVED : :: c_int = 0x80000000 ;
1594+ pub const STATX_ATTR_COMPRESSED : :: c_int = 0x0004 ;
1595+ pub const STATX_ATTR_IMMUTABLE : :: c_int = 0x0010 ;
1596+ pub const STATX_ATTR_APPEND : :: c_int = 0x0020 ;
1597+ pub const STATX_ATTR_NODUMP : :: c_int = 0x0040 ;
1598+ pub const STATX_ATTR_ENCRYPTED : :: c_int = 0x0800 ;
1599+ pub const STATX_ATTR_AUTOMOUNT : :: c_int = 0x1000 ;
1600+ pub const STATX_ATTR_MOUNT_ROOT : :: c_int = 0x2000 ;
1601+ pub const STATX_ATTR_VERITY : :: c_int = 0x100000 ;
1602+ pub const STATX_ATTR_DAX : :: c_int = 0x200000 ;
1603+ }
1604+ }
1605+
15321606const_fn ! {
15331607 { const } fn CMSG_ALIGN ( len: usize ) -> usize {
15341608 len + :: mem:: size_of:: <usize >( ) - 1 & !( :: mem:: size_of:: <usize >( ) - 1 )
@@ -1888,6 +1962,21 @@ cfg_if! {
18881962 }
18891963}
18901964
1965+ // The statx syscall, available on some libcs.
1966+ cfg_if ! {
1967+ if #[ cfg( any( target_env = "gnu" , target_os = "android" ) ) ] {
1968+ extern "C" {
1969+ pub fn statx(
1970+ dirfd: :: c_int,
1971+ pathname: * const :: c_char,
1972+ flags: :: c_int,
1973+ mask: :: c_uint,
1974+ statxbuf: * mut statx,
1975+ ) -> :: c_int;
1976+ }
1977+ }
1978+ }
1979+
18911980cfg_if ! {
18921981 if #[ cfg( target_os = "emscripten" ) ] {
18931982 mod emscripten;
0 commit comments