1 /* Generic statx-related definitions and declarations. 2 Copyright (C) 2018-2019 Free Software Foundation, Inc. 3 4 The GNU C Library is free software; you can redistribute it and/or 5 modify it under the terms of the GNU Lesser General Public 6 License as published by the Free Software Foundation; either 7 version 2.1 of the License, or (at your option) any later version. 8 9 The GNU C Library is distributed in the hope that it will be useful, 10 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 Lesser General Public License for more details. 13 14 You should have received a copy of the GNU Lesser General Public 15 License along with the GNU C Library; if not, see 16 <https://www.gnu.org/licenses/>. */ 17 18 /* This interface is based on <linux/stat.h> in Linux. */ 19 20 #ifndef _SYS_STAT_H 21 # error Never include <bits/statx.h> directly, include <sys/stat.h> instead. 22 #endif 23 24 struct statx_timestamp 25 { 26 __int64_t tv_sec; 27 __uint32_t tv_nsec; 28 __int32_t __statx_timestamp_pad1[1]; 29 }; 30 31 /* Warning: The kernel may add additional fields to this struct in the 32 future. Only use this struct for calling the statx function, not 33 for storing data. (Expansion will be controlled by the mask 34 argument of the statx function.) */ 35 struct statx 36 { 37 __uint32_t stx_mask; 38 __uint32_t stx_blksize; 39 __uint64_t stx_attributes; 40 __uint32_t stx_nlink; 41 __uint32_t stx_uid; 42 __uint32_t stx_gid; 43 __uint16_t stx_mode; 44 __uint16_t __statx_pad1[1]; 45 __uint64_t stx_ino; 46 __uint64_t stx_size; 47 __uint64_t stx_blocks; 48 __uint64_t stx_attributes_mask; 49 struct statx_timestamp stx_atime; 50 struct statx_timestamp stx_btime; 51 struct statx_timestamp stx_ctime; 52 struct statx_timestamp stx_mtime; 53 __uint32_t stx_rdev_major; 54 __uint32_t stx_rdev_minor; 55 __uint32_t stx_dev_major; 56 __uint32_t stx_dev_minor; 57 __uint64_t __statx_pad2[14]; 58 }; 59 60 #ifndef STATX_TYPE 61 # define STATX_TYPE 0x0001U 62 # define STATX_MODE 0x0002U 63 # define STATX_NLINK 0x0004U 64 # define STATX_UID 0x0008U 65 # define STATX_GID 0x0010U 66 # define STATX_ATIME 0x0020U 67 # define STATX_MTIME 0x0040U 68 # define STATX_CTIME 0x0080U 69 # define STATX_INO 0x0100U 70 # define STATX_SIZE 0x0200U 71 # define STATX_BLOCKS 0x0400U 72 # define STATX_BASIC_STATS 0x07ffU 73 # define STATX_ALL 0x0fffU 74 # define STATX_BTIME 0x0800U 75 # define STATX__RESERVED 0x80000000U 76 77 # define STATX_ATTR_COMPRESSED 0x0004 78 # define STATX_ATTR_IMMUTABLE 0x0010 79 # define STATX_ATTR_APPEND 0x0020 80 # define STATX_ATTR_NODUMP 0x0040 81 # define STATX_ATTR_ENCRYPTED 0x0800 82 # define STATX_ATTR_AUTOMOUNT 0x1000 83 #endif /* !STATX_TYPE */ 84 85 __BEGIN_DECLS 86 87 /* Fill *BUF with information about PATH in DIRFD. */ 88 int statx (int __dirfd, const char *__restrict __path, int __flags, 89 unsigned int __mask, struct statx *__restrict __buf) 90 __THROW __nonnull ((2, 5)); 91 92 __END_DECLS 93 94