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 57 #if defined __cplusplus && defined GNULIB_NAMESPACE 58 # define _GL_BEGIN_NAMESPACE namespace GNULIB_NAMESPACE { 59 # define _GL_END_NAMESPACE } 61 # define _GL_BEGIN_NAMESPACE 62 # define _GL_END_NAMESPACE 126 #if defined __cplusplus 127 # define _GL_EXTERN_C extern "C" 129 # define _GL_EXTERN_C extern 139 #define _GL_FUNCDECL_RPL(func,rettype,parameters_and_attributes) \ 140 _GL_FUNCDECL_RPL_1 (rpl_##func, rettype, parameters_and_attributes) 141 #define _GL_FUNCDECL_RPL_1(rpl_func,rettype,parameters_and_attributes) \ 142 _GL_EXTERN_C rettype rpl_func parameters_and_attributes 151 #define _GL_FUNCDECL_SYS(func,rettype,parameters_and_attributes) \ 152 _GL_EXTERN_C rettype func parameters_and_attributes 163 #define _GL_CXXALIAS_RPL(func,rettype,parameters) \ 164 _GL_CXXALIAS_RPL_1 (func, rpl_##func, rettype, parameters) 165 #if defined __cplusplus && defined GNULIB_NAMESPACE 166 # define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \ 167 namespace GNULIB_NAMESPACE \ 169 static const struct _gl_ ## func ## _wrapper \ 171 typedef rettype (*type) parameters; \ 172 inline type rpl () const { return ::rpl_func; } \ 173 inline operator type () const { return rpl (); } \ 176 _GL_EXTERN_C int _gl_cxxalias_dummy 178 # define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \ 179 _GL_EXTERN_C int _gl_cxxalias_dummy 187 #if defined __cplusplus && defined GNULIB_NAMESPACE 188 # define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \ 189 namespace GNULIB_NAMESPACE \ 191 static const struct _gl_ ## func ## _wrapper \ 193 typedef rettype (*type) parameters; \ 194 inline type rpl () const \ 195 { return reinterpret_cast<type>(::rpl_func); } \ 196 inline operator type () const { return rpl (); } \ 199 _GL_EXTERN_C int _gl_cxxalias_dummy 201 # define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \ 202 _GL_EXTERN_C int _gl_cxxalias_dummy 215 #if defined __cplusplus && defined GNULIB_NAMESPACE 216 # define _GL_CXXALIAS_SYS(func,rettype,parameters) \ 217 namespace GNULIB_NAMESPACE \ 219 static const struct _gl_ ## func ## _wrapper \ 221 typedef rettype (*type) parameters; \ 222 inline type rpl () const { return ::func; } \ 223 inline operator type () const { return rpl (); } \ 226 _GL_EXTERN_C int _gl_cxxalias_dummy 228 # define _GL_CXXALIAS_SYS(func,rettype,parameters) \ 229 _GL_EXTERN_C int _gl_cxxalias_dummy 237 #if defined __cplusplus && defined GNULIB_NAMESPACE 238 # define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \ 239 namespace GNULIB_NAMESPACE \ 241 static const struct _gl_ ## func ## _wrapper \ 243 typedef rettype (*type) parameters; \ 244 inline type rpl () const \ 245 { return reinterpret_cast<type>(::func); } \ 246 inline operator type () const { return rpl (); }\ 249 _GL_EXTERN_C int _gl_cxxalias_dummy 251 # define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \ 252 _GL_EXTERN_C int _gl_cxxalias_dummy 261 #if defined __cplusplus && defined GNULIB_NAMESPACE 267 # define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \ 268 namespace GNULIB_NAMESPACE \ 270 static const struct _gl_ ## func ## _wrapper \ 272 typedef rettype (*type) parameters; \ 274 inline type rpl () const \ 275 { return reinterpret_cast<type>((rettype2 (*) parameters2)(::func)); }\ 277 inline operator type () const { return rpl (); } \ 280 _GL_EXTERN_C int _gl_cxxalias_dummy 282 # define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \ 283 _GL_EXTERN_C int _gl_cxxalias_dummy 290 #if defined __cplusplus && defined GNULIB_NAMESPACE 291 # define _GL_CXXALIASWARN(func) \ 292 _GL_CXXALIASWARN_1 (func, GNULIB_NAMESPACE) 293 # define _GL_CXXALIASWARN_1(func,namespace) \ 294 _GL_CXXALIASWARN_2 (func, namespace) 298 # define _GL_CXXALIASWARN_2(func,namespace) \ 299 _GL_WARN_ON_USE (func, \ 300 "The symbol ::" #func " refers to the system function. " \ 301 "Use " #namespace "::" #func " instead.") 302 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING 303 # define _GL_CXXALIASWARN_2(func,namespace) \ 304 extern __typeof__ (func) func 306 # define _GL_CXXALIASWARN_2(func,namespace) \ 307 _GL_EXTERN_C int _gl_cxxalias_dummy 310 # define _GL_CXXALIASWARN(func) \ 311 _GL_EXTERN_C int _gl_cxxalias_dummy 317 #if defined __cplusplus && defined GNULIB_NAMESPACE 318 # define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \ 319 _GL_CXXALIASWARN1_1 (func, rettype, parameters_and_attributes, \ 321 # define _GL_CXXALIASWARN1_1(func,rettype,parameters_and_attributes,namespace) \ 322 _GL_CXXALIASWARN1_2 (func, rettype, parameters_and_attributes, namespace) 326 # define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \ 327 _GL_WARN_ON_USE_CXX (func, rettype, parameters_and_attributes, \ 328 "The symbol ::" #func " refers to the system function. " \ 329 "Use " #namespace "::" #func " instead.") 330 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING 331 # define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \ 332 extern __typeof__ (func) func 334 # define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \ 335 _GL_EXTERN_C int _gl_cxxalias_dummy 338 # define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \ 339 _GL_EXTERN_C int _gl_cxxalias_dummy 348 #ifndef _GL_ARG_NONNULL 349 # if (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || __GNUC__ > 3 350 # define _GL_ARG_NONNULL(params) __attribute__ ((__nonnull__ params)) 352 # define _GL_ARG_NONNULL(params) 357 #ifndef _GL_WARN_ON_USE 359 # if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__) 361 # define _GL_WARN_ON_USE(function, message) \ 362 extern __typeof__ (function) function __attribute__ ((__warning__ (message))) 363 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING 365 # define _GL_WARN_ON_USE(function, message) \ 366 extern __typeof__ (function) function 368 # define _GL_WARN_ON_USE(function, message) \ 369 _GL_WARN_EXTERN_C int _gl_warn_on_use 379 #ifndef _GL_WARN_ON_USE_CXX 380 # if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__) 381 # define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \ 382 extern rettype function parameters_and_attributes \ 383 __attribute__ ((__warning__ (msg))) 384 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING 386 # define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \ 387 extern rettype function parameters_and_attributes 389 # define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \ 390 _GL_WARN_EXTERN_C int _gl_warn_on_use 396 #ifndef _GL_WARN_EXTERN_C 397 # if defined __cplusplus 398 # define _GL_WARN_EXTERN_C extern "C" 400 # define _GL_WARN_EXTERN_C extern 407 #if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ 413 #if 0 && ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) 419 # define stat _stati64 424 # define S_IFIFO _S_IFIFO 429 # define S_IFMT 0170000 432 #if STAT_MACROS_BROKEN 448 # define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK) 450 # define S_ISBLK(m) 0 456 # define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR) 458 # define S_ISCHR(m) 0 464 # define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) 466 # define S_ISDIR(m) 0 471 # define S_ISDOOR(m) 0 476 # define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO) 478 # define S_ISFIFO(m) 0 484 # define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK) 486 # define S_ISLNK(m) 0 492 # define S_ISMPB(m) (((m) & S_IFMT) == S_IFMPB) 493 # define S_ISMPC(m) (((m) & S_IFMT) == S_IFMPC) 495 # define S_ISMPB(m) 0 496 # define S_ISMPC(m) 0 501 # define S_ISMPX(m) 0 506 # define S_ISNAM(m) (((m) & S_IFMT) == S_IFNAM) 508 # define S_ISNAM(m) 0 514 # define S_ISNWK(m) (((m) & S_IFMT) == S_IFNWK) 516 # define S_ISNWK(m) 0 521 # define S_ISPORT(m) 0 526 # define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) 528 # define S_ISREG(m) 0 534 # define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK) 536 # define S_ISSOCK(m) 0 542 # define S_TYPEISMQ(p) 0 546 # define S_TYPEISTMO(p) 0 552 # define S_TYPEISSEM(p) (S_ISNAM ((p)->st_mode) && (p)->st_rdev == S_INSEM) 554 # define S_TYPEISSEM(p) 0 560 # define S_TYPEISSHM(p) (S_ISNAM ((p)->st_mode) && (p)->st_rdev == S_INSHD) 562 # define S_TYPEISSHM(p) 0 568 # define S_ISCTG(p) 0 573 # define S_ISOFD(p) 0 578 # define S_ISOFL(p) 0 583 # define S_ISWHT(m) 0 589 # define S_ISUID 04000 592 # define S_ISGID 02000 597 # define S_ISVTX 01000 600 #if !S_IRUSR && S_IREAD 601 # define S_IRUSR S_IREAD 604 # define S_IRUSR 00400 607 # define S_IRGRP (S_IRUSR >> 3) 610 # define S_IROTH (S_IRUSR >> 6) 613 #if !S_IWUSR && S_IWRITE 614 # define S_IWUSR S_IWRITE 617 # define S_IWUSR 00200 620 # define S_IWGRP (S_IWUSR >> 3) 623 # define S_IWOTH (S_IWUSR >> 6) 626 #if !S_IXUSR && S_IEXEC 627 # define S_IXUSR S_IEXEC 630 # define S_IXUSR 00100 633 # define S_IXGRP (S_IXUSR >> 3) 636 # define S_IXOTH (S_IXUSR >> 6) 640 # define S_IRWXU (S_IRUSR | S_IWUSR | S_IXUSR) 643 # define S_IRWXG (S_IRGRP | S_IWGRP | S_IXGRP) 646 # define S_IRWXO (S_IROTH | S_IWOTH | S_IXOTH) 651 # define S_IXUGO (S_IXUSR | S_IXGRP | S_IXOTH) 655 # define S_IRWXUGO (S_IRWXU | S_IRWXG | S_IRWXO) 660 # define UTIME_NOW (-1) 661 # define UTIME_OMIT (-2) 668 (
int fd,
char const *file, mode_t mode,
int flag)
672 (
int fd,
char const *file, mode_t mode,
int flag));
674 #elif defined GNULIB_POSIXCHECK 676 # if HAVE_RAW_DECL_FCHMODAT 678 "use gnulib module openat for portability");
685 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) 687 # define fstat rpl_fstat 697 # define fstat _fstati64 698 #elif defined GNULIB_POSIXCHECK 700 # if HAVE_RAW_DECL_FSTAT 702 "use gnulib module fstat for portability");
709 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) 711 # define fstatat rpl_fstatat 714 (
int fd,
char const *
name,
struct stat *st,
int flags)
717 (
int fd,
char const *
name,
struct stat *st,
int flags));
721 (
int fd,
char const *
name,
struct stat *st,
int flags)
725 (
int fd,
char const *
name,
struct stat *st,
int flags));
728 #elif defined GNULIB_POSIXCHECK 730 # if HAVE_RAW_DECL_FSTATAT 732 "use gnulib module openat for portability");
742 # if 0 || (!1 && defined __sun) 743 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) 745 # define futimens rpl_futimens 758 #elif defined GNULIB_POSIXCHECK 760 # if HAVE_RAW_DECL_FUTIMENS 762 "use gnulib module futimens for portability");
778 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) 779 # define lchmod chmod 784 (
const char *filename, mode_t mode));
795 #elif defined GNULIB_POSIXCHECK 797 # if HAVE_RAW_DECL_LCHMOD 799 "use gnulib module lchmod for portability");
808 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) 813 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) 815 # define lstat rpl_lstat 826 #elif defined GNULIB_POSIXCHECK 828 # if HAVE_RAW_DECL_LSTAT 830 "use gnulib module lstat for portability");
836 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) 838 # define mkdir rpl_mkdir 848 # if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ 850 # if !GNULIB_defined_rpl_mkdir 852 rpl_mkdir (
char const *
name, mode_t mode)
854 return _mkdir (
name);
856 # define GNULIB_defined_rpl_mkdir 1 859 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) 860 # define mkdir rpl_mkdir 877 #elif defined GNULIB_POSIXCHECK 879 # if HAVE_RAW_DECL_MKDIRAT 881 "use gnulib module openat for portability");
888 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) 890 # define mkfifo rpl_mkfifo 903 #elif defined GNULIB_POSIXCHECK 905 # if HAVE_RAW_DECL_MKFIFO 907 "use gnulib module mkfifo for portability");
919 #elif defined GNULIB_POSIXCHECK 921 # if HAVE_RAW_DECL_MKFIFOAT 923 "use gnulib module mkfifoat for portability");
930 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) 932 # define mknod rpl_mknod 946 #elif defined GNULIB_POSIXCHECK 948 # if HAVE_RAW_DECL_MKNOD 950 "use gnulib module mknod for portability");
958 (
int fd,
char const *file, mode_t mode, dev_t dev)
962 (
int fd,
char const *file, mode_t mode, dev_t dev));
964 #elif defined GNULIB_POSIXCHECK 966 # if HAVE_RAW_DECL_MKNODAT 968 "use gnulib module mkfifoat for portability");
978 # if defined _AIX && defined stat && defined _LARGE_FILES 982 # define stat64(name, st) rpl_stat (name, st) 985 # if defined __MINGW32__ && defined _stati64 986 # ifndef _USE_32BIT_TIME_T 989 # define _stat64(name, st) rpl_stat (name, st) 991 # elif defined _MSC_VER && defined _stati64 992 # ifdef _USE_32BIT_TIME_T 995 # define _stat32i64(name, st) rpl_stat (name, st) 999 # define _stat64(name, st) rpl_stat (name, st) 1003 # define _stati64(name, st) rpl_stat (name, st) 1005 # elif defined __MINGW32__ && defined stat 1006 # ifdef _USE_32BIT_TIME_T 1009 # define _stat32i64(name, st) rpl_stat (name, st) 1013 # define _stat64(name, st) rpl_stat (name, st) 1015 # elif defined _MSC_VER && defined stat 1016 # ifdef _USE_32BIT_TIME_T 1019 # define _stat32(name, st) rpl_stat (name, st) 1023 # define _stat64i32(name, st) rpl_stat (name, st) 1027 # define stat(name, st) rpl_stat (name, st) 1032 #elif defined GNULIB_POSIXCHECK 1034 # if HAVE_RAW_DECL_STAT 1036 "use gnulib module stat for portability");
1046 # if 0 || (!1 && defined __sun) 1047 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) 1049 # define utimensat rpl_utimensat 1052 struct timespec
const times[2],
int flag)
1055 struct timespec
const times[2],
int flag));
1059 struct timespec
const times[2],
int flag)
1063 struct timespec
const times[2],
int flag));
1068 #elif defined GNULIB_POSIXCHECK 1070 # if HAVE_RAW_DECL_UTIMENSAT 1072 "use gnulib module utimensat for portability");
#define _GL_CXXALIAS_RPL(func, rettype, parameters)
#define _GL_WARN_ON_USE(function, message)
#define _GL_ARG_NONNULL(params)
#define _GL_CXXALIAS_SYS_CAST(func, rettype, parameters)
#define _GL_FUNCDECL_SYS(func, rettype, parameters_and_attributes)
#define _GL_CXXALIAS_SYS(func, rettype, parameters)
#define _GL_CXXALIAS_RPL_1(func, rpl_func, rettype, parameters)
#define _GL_CXXALIAS_RPL_CAST_1(func, rpl_func, rettype, parameters)
#define _GL_CXXALIASWARN(func)
#define _GL_FUNCDECL_RPL(func, rettype, parameters_and_attributes)