master
 1/* Generic statx-related definitions and declarations.
 2   Copyright (C) 2018-2025 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   <https://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/statx-generic.h> directly, include <sys/stat.h> instead.
23#endif
24
25#include <bits/types/struct_statx_timestamp.h>
26#include <bits/types/struct_statx.h>
27
28// zig patch: check target glibc version
29#if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 28) || __GLIBC__ > 2
30
31#ifndef STATX_TYPE
32# define STATX_TYPE 0x0001U
33# define STATX_MODE 0x0002U
34# define STATX_NLINK 0x0004U
35# define STATX_UID 0x0008U
36# define STATX_GID 0x0010U
37# define STATX_ATIME 0x0020U
38# define STATX_MTIME 0x0040U
39# define STATX_CTIME 0x0080U
40# define STATX_INO 0x0100U
41# define STATX_SIZE 0x0200U
42# define STATX_BLOCKS 0x0400U
43# define STATX_BASIC_STATS 0x07ffU
44# define STATX_ALL 0x0fffU
45# define STATX_BTIME 0x0800U
46# define STATX_MNT_ID 0x1000U
47# define STATX_DIOALIGN 0x2000U
48# define STATX_MNT_ID_UNIQUE 0x4000U
49# define STATX_SUBVOL 0x8000U
50# define STATX_WRITE_ATOMIC 0x00010000U
51# define STATX__RESERVED 0x80000000U
52
53# define STATX_ATTR_COMPRESSED 0x0004
54# define STATX_ATTR_IMMUTABLE 0x0010
55# define STATX_ATTR_APPEND 0x0020
56# define STATX_ATTR_NODUMP 0x0040
57# define STATX_ATTR_ENCRYPTED 0x0800
58# define STATX_ATTR_AUTOMOUNT 0x1000
59# define STATX_ATTR_MOUNT_ROOT 0x2000
60# define STATX_ATTR_VERITY 0x100000
61# define STATX_ATTR_DAX 0x200000
62# define STATX_ATTR_WRITE_ATOMIC 0x00400000
63#endif /* !STATX_TYPE */
64
65__BEGIN_DECLS
66
67/* Fill *BUF with information about PATH in DIRFD.  */
68int statx (int __dirfd, const char *__restrict __path, int __flags,
69           unsigned int __mask, struct statx *__restrict __buf)
70  __THROW __nonnull ((5));
71
72__END_DECLS
73
74#endif /* (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 28) || __GLIBC__ > 2 */