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