25 #pragma GCC system_header 29 #if defined __need_system_sys_stat_h 32 #include_next <sys/stat.h> 37 #ifndef _GL_SYS_STAT_H 47 #include_next <sys/stat.h> 49 #ifndef _GL_SYS_STAT_H 50 #define _GL_SYS_STAT_H 73 #if defined __cplusplus && defined GNULIB_NAMESPACE 74 # define _GL_BEGIN_NAMESPACE namespace GNULIB_NAMESPACE { 75 # define _GL_END_NAMESPACE } 77 # define _GL_BEGIN_NAMESPACE 78 # define _GL_END_NAMESPACE 142 #if defined __cplusplus 143 # define _GL_EXTERN_C extern "C" 145 # define _GL_EXTERN_C extern 155 #define _GL_FUNCDECL_RPL(func,rettype,parameters_and_attributes) \ 156 _GL_FUNCDECL_RPL_1 (rpl_##func, rettype, parameters_and_attributes) 157 #define _GL_FUNCDECL_RPL_1(rpl_func,rettype,parameters_and_attributes) \ 158 _GL_EXTERN_C rettype rpl_func parameters_and_attributes 167 #define _GL_FUNCDECL_SYS(func,rettype,parameters_and_attributes) \ 168 _GL_EXTERN_C rettype func parameters_and_attributes 179 #define _GL_CXXALIAS_RPL(func,rettype,parameters) \ 180 _GL_CXXALIAS_RPL_1 (func, rpl_##func, rettype, parameters) 181 #if defined __cplusplus && defined GNULIB_NAMESPACE 182 # define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \ 183 namespace GNULIB_NAMESPACE \ 185 static const struct _gl_ ## func ## _wrapper \ 187 typedef rettype (*type) parameters; \ 189 inline operator type () const \ 195 _GL_EXTERN_C int _gl_cxxalias_dummy 197 # define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \ 198 _GL_EXTERN_C int _gl_cxxalias_dummy 206 #if defined __cplusplus && defined GNULIB_NAMESPACE 207 # define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \ 208 namespace GNULIB_NAMESPACE \ 210 static const struct _gl_ ## func ## _wrapper \ 212 typedef rettype (*type) parameters; \ 214 inline operator type () const \ 216 return reinterpret_cast<type>(::rpl_func); \ 220 _GL_EXTERN_C int _gl_cxxalias_dummy 222 # define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \ 223 _GL_EXTERN_C int _gl_cxxalias_dummy 236 #if defined __cplusplus && defined GNULIB_NAMESPACE 237 # define _GL_CXXALIAS_SYS(func,rettype,parameters) \ 238 namespace GNULIB_NAMESPACE \ 240 static const struct _gl_ ## func ## _wrapper \ 242 typedef rettype (*type) parameters; \ 244 inline operator type () const \ 250 _GL_EXTERN_C int _gl_cxxalias_dummy 252 # define _GL_CXXALIAS_SYS(func,rettype,parameters) \ 253 _GL_EXTERN_C int _gl_cxxalias_dummy 261 #if defined __cplusplus && defined GNULIB_NAMESPACE 262 # define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \ 263 namespace GNULIB_NAMESPACE \ 265 static const struct _gl_ ## func ## _wrapper \ 267 typedef rettype (*type) parameters; \ 269 inline operator type () const \ 271 return reinterpret_cast<type>(::func); \ 275 _GL_EXTERN_C int _gl_cxxalias_dummy 277 # define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \ 278 _GL_EXTERN_C int _gl_cxxalias_dummy 287 #if defined __cplusplus && defined GNULIB_NAMESPACE 293 # define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \ 294 namespace GNULIB_NAMESPACE \ 296 static const struct _gl_ ## func ## _wrapper \ 298 typedef rettype (*type) parameters; \ 300 inline operator type () const \ 302 return reinterpret_cast<type>((rettype2 (*) parameters2)(::func)); \ 306 _GL_EXTERN_C int _gl_cxxalias_dummy 308 # define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \ 309 _GL_EXTERN_C int _gl_cxxalias_dummy 316 #if defined __cplusplus && defined GNULIB_NAMESPACE 317 # define _GL_CXXALIASWARN(func) \ 318 _GL_CXXALIASWARN_1 (func, GNULIB_NAMESPACE) 319 # define _GL_CXXALIASWARN_1(func,namespace) \ 320 _GL_CXXALIASWARN_2 (func, namespace) 324 # define _GL_CXXALIASWARN_2(func,namespace) \ 325 _GL_WARN_ON_USE (func, \ 326 "The symbol ::" #func " refers to the system function. " \ 327 "Use " #namespace "::" #func " instead.") 328 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING 329 # define _GL_CXXALIASWARN_2(func,namespace) \ 330 extern __typeof__ (func) func 332 # define _GL_CXXALIASWARN_2(func,namespace) \ 333 _GL_EXTERN_C int _gl_cxxalias_dummy 336 # define _GL_CXXALIASWARN(func) \ 337 _GL_EXTERN_C int _gl_cxxalias_dummy 343 #if defined __cplusplus && defined GNULIB_NAMESPACE 344 # define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \ 345 _GL_CXXALIASWARN1_1 (func, rettype, parameters_and_attributes, \ 347 # define _GL_CXXALIASWARN1_1(func,rettype,parameters_and_attributes,namespace) \ 348 _GL_CXXALIASWARN1_2 (func, rettype, parameters_and_attributes, namespace) 352 # define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \ 353 _GL_WARN_ON_USE_CXX (func, rettype, parameters_and_attributes, \ 354 "The symbol ::" #func " refers to the system function. " \ 355 "Use " #namespace "::" #func " instead.") 356 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING 357 # define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \ 358 extern __typeof__ (func) func 360 # define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \ 361 _GL_EXTERN_C int _gl_cxxalias_dummy 364 # define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \ 365 _GL_EXTERN_C int _gl_cxxalias_dummy 390 #ifndef _GL_ARG_NONNULL 391 # if (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || __GNUC__ > 3 392 # define _GL_ARG_NONNULL(params) __attribute__ ((__nonnull__ params)) 394 # define _GL_ARG_NONNULL(params) 462 #ifndef _GL_WARN_ON_USE 464 # if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__) 466 # define _GL_WARN_ON_USE(function, message) \ 467 extern __typeof__ (function) function __attribute__ ((__warning__ (message))) 468 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING 470 # define _GL_WARN_ON_USE(function, message) \ 471 extern __typeof__ (function) function 473 # define _GL_WARN_ON_USE(function, message) \ 474 _GL_WARN_EXTERN_C int _gl_warn_on_use 484 #ifndef _GL_WARN_ON_USE_CXX 485 # if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__) 486 # define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \ 487 extern rettype function parameters_and_attributes \ 488 __attribute__ ((__warning__ (msg))) 489 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING 491 # define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \ 492 extern rettype function parameters_and_attributes 494 # define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \ 495 _GL_WARN_EXTERN_C int _gl_warn_on_use 501 #ifndef _GL_WARN_EXTERN_C 502 # if defined __cplusplus 503 # define _GL_WARN_EXTERN_C extern "C" 505 # define _GL_WARN_EXTERN_C extern 512 #if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ 518 #if 0 && ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) 524 # define stat _stati64 532 # define stat rpl_stat 536 # define stat stat_used_without_requesting_gnulib_module_stat 539 # if !GNULIB_defined_struct_stat 559 blksize_t st_blksize;
574 # define st_atime st_atim.tv_sec 575 # define st_mtime st_mtim.tv_sec 576 # define st_ctime st_ctim.tv_sec 578 # define _GL_WINDOWS_STAT_TIMESPEC 1 580 # define GNULIB_defined_struct_stat 1 585 # define _S_IFBLK 0x6000 588 # define _S_IFLNK 0xA000 591 # define _S_IFSOCK 0xC000 598 # define S_IFIFO _S_IFIFO 603 # define S_IFMT 0170000 606 #if STAT_MACROS_BROKEN 622 # define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK) 624 # define S_ISBLK(m) 0 630 # define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR) 632 # define S_ISCHR(m) 0 638 # define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) 640 # define S_ISDIR(m) 0 645 # define S_ISDOOR(m) 0 650 # define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO) 652 # define S_ISFIFO(m) 0 658 # define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK) 660 # define S_ISLNK(m) 0 666 # define S_ISMPB(m) (((m) & S_IFMT) == S_IFMPB) 667 # define S_ISMPC(m) (((m) & S_IFMT) == S_IFMPC) 669 # define S_ISMPB(m) 0 670 # define S_ISMPC(m) 0 675 # define S_ISMPX(m) 0 680 # define S_ISNAM(m) (((m) & S_IFMT) == S_IFNAM) 682 # define S_ISNAM(m) 0 688 # define S_ISNWK(m) (((m) & S_IFMT) == S_IFNWK) 690 # define S_ISNWK(m) 0 695 # define S_ISPORT(m) 0 700 # define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) 702 # define S_ISREG(m) 0 708 # define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK) 710 # define S_ISSOCK(m) 0 716 # define S_TYPEISMQ(p) 0 720 # define S_TYPEISTMO(p) 0 726 # define S_TYPEISSEM(p) (S_ISNAM ((p)->st_mode) && (p)->st_rdev == S_INSEM) 728 # define S_TYPEISSEM(p) 0 734 # define S_TYPEISSHM(p) (S_ISNAM ((p)->st_mode) && (p)->st_rdev == S_INSHD) 736 # define S_TYPEISSHM(p) 0 742 # define S_ISCTG(p) 0 747 # define S_ISOFD(p) 0 752 # define S_ISOFL(p) 0 757 # define S_ISWHT(m) 0 763 # define S_ISUID 04000 766 # define S_ISGID 02000 771 # define S_ISVTX 01000 774 #if !S_IRUSR && S_IREAD 775 # define S_IRUSR S_IREAD 778 # define S_IRUSR 00400 781 # define S_IRGRP (S_IRUSR >> 3) 784 # define S_IROTH (S_IRUSR >> 6) 787 #if !S_IWUSR && S_IWRITE 788 # define S_IWUSR S_IWRITE 791 # define S_IWUSR 00200 794 # define S_IWGRP (S_IWUSR >> 3) 797 # define S_IWOTH (S_IWUSR >> 6) 800 #if !S_IXUSR && S_IEXEC 801 # define S_IXUSR S_IEXEC 804 # define S_IXUSR 00100 807 # define S_IXGRP (S_IXUSR >> 3) 810 # define S_IXOTH (S_IXUSR >> 6) 814 # define S_IRWXU (S_IRUSR | S_IWUSR | S_IXUSR) 817 # define S_IRWXG (S_IRGRP | S_IWGRP | S_IXGRP) 820 # define S_IRWXO (S_IROTH | S_IWOTH | S_IXOTH) 825 # define S_IXUGO (S_IXUSR | S_IXGRP | S_IXOTH) 829 # define S_IRWXUGO (S_IRWXU | S_IRWXG | S_IRWXO) 834 # define UTIME_NOW (-1) 835 # define UTIME_OMIT (-2) 842 (
int fd,
char const *file, mode_t mode,
int flag)
846 (
int fd,
char const *file, mode_t mode,
int flag));
848 #elif defined GNULIB_POSIXCHECK 850 # if HAVE_RAW_DECL_FCHMODAT 852 "use gnulib module openat for portability");
859 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) 861 # define fstat rpl_fstat 871 # define fstat fstat_used_without_requesting_gnulib_module_fstat 874 # define fstat _fstati64 875 #elif defined GNULIB_POSIXCHECK 877 # if HAVE_RAW_DECL_FSTAT 879 "use gnulib module fstat for portability");
886 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) 888 # define fstatat rpl_fstatat 891 (
int fd,
char const *name,
struct stat *st,
int flags)
894 (
int fd,
char const *name,
struct stat *st,
int flags));
898 (
int fd,
char const *name,
struct stat *st,
int flags)
902 (
int fd,
char const *name,
struct stat *st,
int flags));
907 # define fstatat fstatat_used_without_requesting_gnulib_module_fstatat 908 #elif defined GNULIB_POSIXCHECK 910 # if HAVE_RAW_DECL_FSTATAT 912 "use gnulib module openat for portability");
922 # if 0 || (!1 && defined __sun) 923 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) 925 # define futimens rpl_futimens 938 #elif defined GNULIB_POSIXCHECK 940 # if HAVE_RAW_DECL_FUTIMENS 942 "use gnulib module futimens for portability");
958 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) 959 # define lchmod chmod 964 (
const char *filename, mode_t mode));
975 #elif defined GNULIB_POSIXCHECK 977 # if HAVE_RAW_DECL_LCHMOD 979 "use gnulib module lchmod for portability");
988 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) 993 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) 995 # define lstat rpl_lstat 1008 # define lstat lstat_used_without_requesting_gnulib_module_lstat 1009 #elif defined GNULIB_POSIXCHECK 1011 # if HAVE_RAW_DECL_LSTAT 1013 "use gnulib module lstat for portability");
1019 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) 1021 # define mkdir rpl_mkdir 1031 # if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ 1033 # if !GNULIB_defined_rpl_mkdir 1035 rpl_mkdir (
char const *name, mode_t mode)
1037 return _mkdir (name);
1039 # define GNULIB_defined_rpl_mkdir 1 1042 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) 1043 # define mkdir rpl_mkdir 1060 #elif defined GNULIB_POSIXCHECK 1062 # if HAVE_RAW_DECL_MKDIRAT 1064 "use gnulib module openat for portability");
1071 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) 1073 # define mkfifo rpl_mkfifo 1086 #elif defined GNULIB_POSIXCHECK 1088 # if HAVE_RAW_DECL_MKFIFO 1090 "use gnulib module mkfifo for portability");
1102 #elif defined GNULIB_POSIXCHECK 1104 # if HAVE_RAW_DECL_MKFIFOAT 1106 "use gnulib module mkfifoat for portability");
1113 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) 1115 # define mknod rpl_mknod 1129 #elif defined GNULIB_POSIXCHECK 1131 # if HAVE_RAW_DECL_MKNOD 1133 "use gnulib module mknod for portability");
1141 (
int fd,
char const *file, mode_t mode, dev_t dev)
1145 (
int fd,
char const *file, mode_t mode, dev_t dev));
1147 #elif defined GNULIB_POSIXCHECK 1149 # if HAVE_RAW_DECL_MKNODAT 1151 "use gnulib module mkfifoat for portability");
1162 # if defined _AIX && defined stat && defined _LARGE_FILES 1166 # define stat64(name, st) rpl_stat (name, st) 1169 # if defined __MINGW32__ && defined _stati64 1170 # ifndef _USE_32BIT_TIME_T 1173 # define _stat64(name, st) rpl_stat (name, st) 1175 # elif defined _MSC_VER && defined _stati64 1176 # ifdef _USE_32BIT_TIME_T 1179 # define _stat32i64(name, st) rpl_stat (name, st) 1183 # define _stat64(name, st) rpl_stat (name, st) 1187 # define _stati64(name, st) rpl_stat (name, st) 1189 # elif defined __MINGW32__ && defined stat 1190 # ifdef _USE_32BIT_TIME_T 1193 # define _stat32i64(name, st) rpl_stat (name, st) 1197 # define _stat64(name, st) rpl_stat (name, st) 1199 # elif defined _MSC_VER && defined stat 1200 # ifdef _USE_32BIT_TIME_T 1203 # define _stat32(name, st) rpl_stat (name, st) 1207 # define _stat64i32(name, st) rpl_stat (name, st) 1211 # define stat(name, st) rpl_stat (name, st) 1214 _GL_EXTERN_C int stat (
const char *name,
struct stat *buf)
1221 #elif defined GNULIB_POSIXCHECK 1223 # if HAVE_RAW_DECL_STAT 1225 "use gnulib module stat for portability");
1235 # if 0 || (!1 && defined __sun) 1236 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) 1238 # define utimensat rpl_utimensat 1241 struct timespec const times[2],
int flag)
1244 struct timespec const times[2],
int flag));
1248 struct timespec const times[2],
int flag)
1252 struct timespec const times[2],
int flag));
1257 #elif defined GNULIB_POSIXCHECK 1259 # if HAVE_RAW_DECL_UTIMENSAT 1261 "use gnulib module utimensat for portability");
#define _GL_CXXALIAS_RPL(func, rettype, parameters)
Definition: stat.h:179
#define _GL_WARN_ON_USE(function, message)
Definition: stat.h:473
#define _GL_ARG_NONNULL(params)
Definition: stat.h:394
#define _GL_CXXALIAS_SYS_CAST(func, rettype, parameters)
Definition: stat.h:277
#define _GL_FUNCDECL_SYS(func, rettype, parameters_and_attributes)
Definition: stat.h:167
#define _GL_CXXALIAS_SYS(func, rettype, parameters)
Definition: stat.h:252
#define _GL_EXTERN_C
Definition: stat.h:145
#define _GL_CXXALIAS_RPL_1(func, rpl_func, rettype, parameters)
Definition: stat.h:197
#define _GL_CXXALIAS_RPL_CAST_1(func, rpl_func, rettype, parameters)
Definition: stat.h:222
#define _GL_CXXALIASWARN(func)
Definition: stat.h:336
#define _GL_FUNCDECL_RPL(func, rettype, parameters_and_attributes)
Definition: stat.h:155