1#ifndef _SYS_STAT_H 2#include_next <sys/stat.h> 3#define _SYS_STAT_H 1 4#define _STAT_VER 0 5#include <bits/stat.h> 6 7/* Now define the internal interfaces. */ 8extern int __stat (__const char *__file, struct stat *__buf); 9extern int __fstat (int __fd, struct stat *__buf); 10extern int __lstat (__const char *__file, struct stat *__buf); 11extern int __chmod (__const char *__file, __mode_t __mode); 12extern int __fchmod (int __fd, __mode_t __mode); 13extern __mode_t __umask (__mode_t __mask); 14extern int __mkdir (__const char *__path, __mode_t __mode); 15extern int __mknod (__const char *__path, 16 __mode_t __mode, __dev_t __dev); 17#if 0 18#if !defined NOT_IN_libc || defined IS_IN_rtld 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} 36 37 38/* The `stat', `fstat', `lstat' functions have to be handled special since 39 even while not compiling the library with optimization calls to these 40 functions in the shared library must reference the `xstat' etc functions. 41 We have to use macros but we cannot define them in the normal headers 42 since on user level we must use real functions. */ 43#define stat(fname, buf) __xstat (_STAT_VER, fname, buf) 44#define lstat(fname, buf) __lxstat (_STAT_VER, fname, buf) 45#define __lstat(fname, buf) __lxstat (_STAT_VER, fname, buf) 46#define lstat64(fname, buf) __lxstat64 (_STAT_VER, fname, buf) 47#define stat64(fname, buf) __xstat64 (_STAT_VER, fname, buf) 48#define fstat64(fd, buf) __fxstat64 (_STAT_VER, fd, buf) 49#define fstat(fd, buf) __fxstat (_STAT_VER, fd, buf) 50#define __fstat(fd, buf) __fxstat (_STAT_VER, fd, buf) 51#endif 52#endif 53