| 1 | /* statx-related definitions and declarations. | 
|---|
| 2 | Copyright (C) 2018-2019 Free Software Foundation, Inc. | 
|---|
| 3 | This file is part of the GNU C Library. | 
|---|
| 4 |  | 
|---|
| 5 | The GNU C Library is free software; you can redistribute it and/or | 
|---|
| 6 | modify it under the terms of the GNU Lesser General Public | 
|---|
| 7 | License as published by the Free Software Foundation; either | 
|---|
| 8 | version 2.1 of the License, or (at your option) any later version. | 
|---|
| 9 |  | 
|---|
| 10 | The GNU C Library is distributed in the hope that it will be useful, | 
|---|
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 
|---|
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU | 
|---|
| 13 | Lesser General Public License for more details. | 
|---|
| 14 |  | 
|---|
| 15 | You should have received a copy of the GNU Lesser General Public | 
|---|
| 16 | License along with the GNU C Library; if not, see | 
|---|
| 17 | <http://www.gnu.org/licenses/>.  */ | 
|---|
| 18 |  | 
|---|
| 19 | /* This interface is based on <linux/stat.h> in Linux.  */ | 
|---|
| 20 |  | 
|---|
| 21 | #ifndef _SYS_STAT_H | 
|---|
| 22 | # error Never include <bits/stat.x.h> directly, include <sys/stat.h> instead. | 
|---|
| 23 | #endif | 
|---|
| 24 |  | 
|---|
| 25 | struct statx_timestamp | 
|---|
| 26 | { | 
|---|
| 27 | __int64_t tv_sec; | 
|---|
| 28 | __uint32_t tv_nsec; | 
|---|
| 29 | __int32_t __statx_timestamp_pad1[1]; | 
|---|
| 30 | }; | 
|---|
| 31 |  | 
|---|
| 32 | /* Warning: The kernel may add additional fields to this struct in the | 
|---|
| 33 | future.  Only use this struct for calling the statx function, not | 
|---|
| 34 | for storing data.  (Expansion will be controlled by the mask | 
|---|
| 35 | argument of the statx function.)  */ | 
|---|
| 36 | struct statx | 
|---|
| 37 | { | 
|---|
| 38 | __uint32_t stx_mask; | 
|---|
| 39 | __uint32_t stx_blksize; | 
|---|
| 40 | __uint64_t stx_attributes; | 
|---|
| 41 | __uint32_t stx_nlink; | 
|---|
| 42 | __uint32_t stx_uid; | 
|---|
| 43 | __uint32_t stx_gid; | 
|---|
| 44 | __uint16_t stx_mode; | 
|---|
| 45 | __uint16_t __statx_pad1[1]; | 
|---|
| 46 | __uint64_t stx_ino; | 
|---|
| 47 | __uint64_t stx_size; | 
|---|
| 48 | __uint64_t stx_blocks; | 
|---|
| 49 | __uint64_t stx_attributes_mask; | 
|---|
| 50 | struct statx_timestamp stx_atime; | 
|---|
| 51 | struct statx_timestamp stx_btime; | 
|---|
| 52 | struct statx_timestamp stx_ctime; | 
|---|
| 53 | struct statx_timestamp stx_mtime; | 
|---|
| 54 | __uint32_t stx_rdev_major; | 
|---|
| 55 | __uint32_t stx_rdev_minor; | 
|---|
| 56 | __uint32_t stx_dev_major; | 
|---|
| 57 | __uint32_t stx_dev_minor; | 
|---|
| 58 | __uint64_t __statx_pad2[14]; | 
|---|
| 59 | }; | 
|---|
| 60 |  | 
|---|
| 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 |  | 
|---|
| 84 | __BEGIN_DECLS | 
|---|
| 85 |  | 
|---|
| 86 | /* Fill *BUF with information about PATH in DIRFD.  */ | 
|---|
| 87 | int statx (int __dirfd, const char *__restrict __path, int __flags, | 
|---|
| 88 | unsigned int __mask, struct statx *__restrict __buf) | 
|---|
| 89 | __THROW __nonnull ((2, 5)); | 
|---|
| 90 |  | 
|---|
| 91 | __END_DECLS | 
|---|
| 92 |  | 
|---|