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