support_become_root: Enable file creation in user namespaces
[glibc.git] / include / sys / stat.h
blobb82d4527801d4797bcd18ba3729a96379163b044
1 #ifndef _SYS_STAT_H
2 #include <io/sys/stat.h>
4 #ifndef _ISOMAC
5 /* Now define the internal interfaces. */
6 extern int __stat (const char *__file, struct stat *__buf);
7 extern int __fstat (int __fd, struct stat *__buf);
8 extern int __lstat (const char *__file, struct stat *__buf);
9 extern int __chmod (const char *__file, __mode_t __mode);
10 libc_hidden_proto (__chmod)
11 extern int __fchmod (int __fd, __mode_t __mode);
12 extern __mode_t __umask (__mode_t __mask);
13 extern int __mkdir (const char *__path, __mode_t __mode);
14 libc_hidden_proto (__mkdir)
15 extern int __mknod (const char *__path,
16 __mode_t __mode, __dev_t __dev);
17 #if IS_IN (libc) || (IS_IN (rtld) && !defined NO_RTLD_HIDDEN)
18 hidden_proto (__fxstat)
19 hidden_proto (__fxstat64)
20 hidden_proto (__lxstat)
21 hidden_proto (__lxstat64)
22 hidden_proto (__xstat)
23 hidden_proto (__xstat64)
24 #endif
25 extern __inline__ int __stat (const char *__path, struct stat *__statbuf)
27 return __xstat (_STAT_VER, __path, __statbuf);
29 libc_hidden_proto (__xmknod)
30 extern __inline__ int __mknod (const char *__path, __mode_t __mode,
31 __dev_t __dev)
33 return __xmknod (_MKNOD_VER, __path, __mode, &__dev);
35 libc_hidden_proto (__xmknodat)
37 libc_hidden_proto (__fxstatat)
38 libc_hidden_proto (__fxstatat64)
40 # if IS_IN (rtld) && !defined NO_RTLD_HIDDEN
41 extern __typeof (__fxstatat64) __fxstatat64 attribute_hidden;
42 # endif
44 /* The `stat', `fstat', `lstat' functions have to be handled special since
45 even while not compiling the library with optimization calls to these
46 functions in the shared library must reference the `xstat' etc functions.
47 We have to use macros but we cannot define them in the normal headers
48 since on user level we must use real functions. */
49 #define stat(fname, buf) __xstat (_STAT_VER, fname, buf)
50 #define lstat(fname, buf) __lxstat (_STAT_VER, fname, buf)
51 #define __lstat(fname, buf) __lxstat (_STAT_VER, fname, buf)
52 #define lstat64(fname, buf) __lxstat64 (_STAT_VER, fname, buf)
53 #define __lstat64(fname, buf) __lxstat64 (_STAT_VER, fname, buf)
54 #define stat64(fname, buf) __xstat64 (_STAT_VER, fname, buf)
55 #define fstat64(fd, buf) __fxstat64 (_STAT_VER, fd, buf)
56 #define __fstat64(fd, buf) __fxstat64 (_STAT_VER, fd, buf)
57 #define fstat(fd, buf) __fxstat (_STAT_VER, fd, buf)
58 #define __fstat(fd, buf) __fxstat (_STAT_VER, fd, buf)
59 #define __fstatat(dfd, fname, buf, flag) \
60 __fxstatat (_STAT_VER, dfd, fname, buf, flag)
61 #define __fstatat64(dfd, fname, buf, flag) \
62 __fxstatat64 (_STAT_VER, dfd, fname, buf, flag)
63 #endif
64 #endif