master
  1#ifndef _SYS_STAT_H
  2#include <io/sys/stat.h>
  3
  4#ifndef _ISOMAC
  5# include <xstatver.h>
  6# include <struct___timespec64.h>
  7# include <struct_stat_time64.h>
  8# include <stdbool.h>
  9
 10static inline bool
 11in_ino_t_range (__ino64_t v)
 12{
 13  __ino_t s = v;
 14  return s == v;
 15}
 16
 17static inline bool
 18in_off_t_range (__off64_t v)
 19{
 20  __off_t s = v;
 21  return s == v;
 22}
 23
 24static inline bool
 25in_blkcnt_t_range (__blkcnt64_t v)
 26{
 27  __blkcnt_t s = v;
 28  return s == v;
 29}
 30
 31/* Now define the internal interfaces. */
 32extern int __stat (const char *__file, struct stat *__buf);
 33extern int __stat64 (const char *__file, struct stat64 *__buf);
 34extern int __fstat (int __fd, struct stat *__buf);
 35extern int __fstat64 (int __fd, struct stat64 *__buf);
 36extern int __lstat (const char *__file, struct stat *__buf);
 37extern int __lstat64 (const char *__file, struct stat64 *__buf);
 38extern int __fstatat (int dirfd, const char *pathname, struct stat *buf,
 39		      int flags);
 40extern int __fstatat64 (int dirfd, const char *pathname, struct stat64 *buf,
 41			int flags);
 42# if IS_IN (libc) || (IS_IN (rtld) && !defined NO_RTLD_HIDDEN)
 43hidden_proto (__stat64)
 44hidden_proto (__fstat64)
 45hidden_proto (__lstat64)
 46hidden_proto (__fstatat64)
 47# endif
 48
 49# if __TIMESIZE == 64 || defined NO_RTLD_HIDDEN
 50#  define __stat64_time64  __stat64
 51#  define __fstat64_time64  __fstat64
 52#  define __lstat64_time64  __lstat64
 53#  define __fstatat64_time64  __fstatat64
 54# else
 55extern int __stat64_time64 (const char *file, struct __stat64_t64 *buf);
 56hidden_proto (__stat64_time64);
 57extern int __lstat64_time64 (const char *file, struct __stat64_t64 *buf);
 58hidden_proto (__lstat64_time64);
 59extern int __fstat64_time64 (int fd, struct __stat64_t64 *buf);
 60hidden_proto (__fstat64_time64);
 61extern int __fstatat64_time64 (int dirfd, const char *pathname,
 62			       struct __stat64_t64 *buf, int flags);
 63hidden_proto (__fstatat64_time64);
 64# endif
 65
 66extern int __chmod (const char *__file, __mode_t __mode);
 67libc_hidden_proto (__chmod)
 68extern int __fchmod (int __fd, __mode_t __mode);
 69extern int __fchmodat (int __fd, const char *__file, mode_t __mode, int __flag);
 70libc_hidden_proto (fchmodat)
 71extern __mode_t __umask (__mode_t __mask);
 72extern int __mkdir (const char *__path, __mode_t __mode);
 73libc_hidden_proto (__mkdir)
 74extern int __mkdirat (int __fd, const char *__path, mode_t __mode);
 75
 76extern int __mknodat (int fd, const char *path, mode_t mode, dev_t dev);
 77libc_hidden_proto (__mknodat);
 78extern int __mknod (const char *__path,
 79		    __mode_t __mode, __dev_t __dev);
 80libc_hidden_proto (__mknod);
 81
 82extern int __xmknod (int __ver, const char *__path, __mode_t __mode,
 83		     __dev_t *__dev);
 84extern int __xmknodat (int __ver, int __fd, const char *__path,
 85		       __mode_t __mode, __dev_t *__dev);
 86
 87int __fxstat (int __ver, int __fildes, struct stat *__stat_buf);
 88int __xstat (int __ver, const char *__filename,
 89	     struct stat *__stat_buf);
 90int __lxstat (int __ver, const char *__filename, struct stat *__stat_buf);
 91int __fxstatat (int __ver, int __fildes, const char *__filename,
 92		struct stat *__stat_buf, int __flag);
 93int __fxstat64 (int ver, int __fildes, struct stat64 *__stat_buf);
 94int __xstat64 (int ver, const char *__filename, struct stat64 *__stat_buf);
 95int __lxstat64 (int ver, const char *__filename, struct stat64 *__stat_buf);
 96int __fxstatat64 (int ver, int __fildes, const char *__filename,
 97		  struct stat64 *__stat_buf, int __flag);
 98
 99#endif
100#endif