X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=gnu%2Fsys_stat.in.h;h=5cf467ac6c1c382642019ae0347324d18bcda6b4;hb=daa269958ad8d50ef8154ccb65e58acaf7a6dd99;hp=75e38ed6a6e9f8d441751f980c19da4c6a75d876;hpb=22f1eb8bc17e5be72dd23d42d6aaa60196ac22e6;p=debian%2Ftar diff --git a/gnu/sys_stat.in.h b/gnu/sys_stat.in.h index 75e38ed6..5cf467ac 100644 --- a/gnu/sys_stat.in.h +++ b/gnu/sys_stat.in.h @@ -1,7 +1,7 @@ /* -*- buffer-read-only: t -*- vi: set ro: */ /* DO NOT EDIT! GENERATED AUTOMATICALLY! */ /* Provide a more complete sys/stat header file. - Copyright (C) 2005-2010 Free Software Foundation, Inc. + Copyright (C) 2005-2013 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -14,8 +14,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program; if not, see . */ /* Written by Eric Blake, Paul Eggert, and Jim Meyering. */ @@ -26,6 +25,7 @@ #if __GNUC__ >= 3 @PRAGMA_SYSTEM_HEADER@ #endif +@PRAGMA_COLUMNS@ #if defined __need_system_sys_stat_h /* Special invocation convention. */ @@ -35,9 +35,10 @@ #else /* Normal invocation convention. */ -#ifndef _GL_SYS_STAT_H +#ifndef _@GUARD_PREFIX@_SYS_STAT_H -/* Get nlink_t. */ +/* Get nlink_t. + May also define off_t to a 64-bit type on native Windows. */ #include /* Get struct timespec. */ @@ -46,8 +47,8 @@ /* The include_next requires a split double-inclusion guard. */ #@INCLUDE_NEXT@ @NEXT_SYS_STAT_H@ -#ifndef _GL_SYS_STAT_H -#define _GL_SYS_STAT_H +#ifndef _@GUARD_PREFIX@_SYS_STAT_H +#define _@GUARD_PREFIX@_SYS_STAT_H /* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ @@ -56,11 +57,29 @@ /* The definition of _GL_WARN_ON_USE is copied here. */ /* Before doing "#define mkdir rpl_mkdir" below, we need to include all - headers that may declare mkdir(). */ + headers that may declare mkdir(). Native Windows platforms declare mkdir + in and/or , not in . */ #if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +# include /* mingw32, mingw64 */ +# include /* mingw64, MSVC 9 */ +#endif + +/* Native Windows platforms declare umask() in . */ +#if 0 && ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) # include #endif +/* Large File Support on native Windows. */ +#if @WINDOWS_64_BIT_ST_SIZE@ +# define stat _stati64 +#endif + +#ifndef S_IFIFO +# ifdef _S_IFIFO +# define S_IFIFO _S_IFIFO +# endif +#endif + #ifndef S_IFMT # define S_IFMT 0170000 #endif @@ -133,6 +152,10 @@ # endif #endif +#ifndef S_ISMPX /* AIX */ +# define S_ISMPX(m) 0 +#endif + #ifndef S_ISNAM /* Xenix */ # ifdef S_IFNAM # define S_ISNAM(m) (((m) & S_IFMT) == S_IFNAM) @@ -312,16 +335,28 @@ _GL_WARN_ON_USE (fchmodat, "fchmodat is not portable - " #endif -#if @REPLACE_FSTAT@ -# if !(defined __cplusplus && defined GNULIB_NAMESPACE) -# define fstat rpl_fstat -# endif +#if @GNULIB_FSTAT@ +# if @REPLACE_FSTAT@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef fstat +# define fstat rpl_fstat +# endif _GL_FUNCDECL_RPL (fstat, int, (int fd, struct stat *buf) _GL_ARG_NONNULL ((2))); _GL_CXXALIAS_RPL (fstat, int, (int fd, struct stat *buf)); -#else +# else _GL_CXXALIAS_SYS (fstat, int, (int fd, struct stat *buf)); -#endif +# endif _GL_CXXALIASWARN (fstat); +#elif @WINDOWS_64_BIT_ST_SIZE@ +/* Above, we define stat to _stati64. */ +# define fstat _fstati64 +#elif defined GNULIB_POSIXCHECK +# undef fstat +# if HAVE_RAW_DECL_FSTAT +_GL_WARN_ON_USE (fstat, "fstat has portability problems - " + "use gnulib module fstat for portability"); +# endif +#endif #if @GNULIB_FSTATAT@ @@ -355,7 +390,11 @@ _GL_WARN_ON_USE (fstatat, "fstatat is not portable - " #if @GNULIB_FUTIMENS@ -# if @REPLACE_FUTIMENS@ +/* Use the rpl_ prefix also on Solaris <= 9, because on Solaris 9 our futimens + implementation relies on futimesat, which on Solaris 10 makes an invocation + to futimens that is meant to invoke the libc's futimens(), not gnulib's + futimens(). */ +# if @REPLACE_FUTIMENS@ || (!@HAVE_FUTIMENS@ && defined __sun) # if !(defined __cplusplus && defined GNULIB_NAMESPACE) # undef futimens # define futimens rpl_futimens @@ -368,7 +407,9 @@ _GL_FUNCDECL_SYS (futimens, int, (int fd, struct timespec const times[2])); # endif _GL_CXXALIAS_SYS (futimens, int, (int fd, struct timespec const times[2])); # endif +# if @HAVE_FUTIMENS@ _GL_CXXALIASWARN (futimens); +# endif #elif defined GNULIB_POSIXCHECK # undef futimens # if HAVE_RAW_DECL_FUTIMENS @@ -392,7 +433,10 @@ _GL_WARN_ON_USE (futimens, "futimens is not portable - " # if !(defined __cplusplus && defined GNULIB_NAMESPACE) # define lchmod chmod # endif -_GL_CXXALIAS_RPL_1 (lchmod, chmod, int, (const char *filename, mode_t mode)); +/* Need to cast, because on mingw, the second parameter of chmod is + int mode. */ +_GL_CXXALIAS_RPL_CAST_1 (lchmod, chmod, int, + (const char *filename, mode_t mode)); # else # if 0 /* assume already declared */ _GL_FUNCDECL_SYS (lchmod, int, (const char *filename, mode_t mode) @@ -400,7 +444,9 @@ _GL_FUNCDECL_SYS (lchmod, int, (const char *filename, mode_t mode) # endif _GL_CXXALIAS_SYS (lchmod, int, (const char *filename, mode_t mode)); # endif +# if @HAVE_LCHMOD@ _GL_CXXALIASWARN (lchmod); +# endif #elif defined GNULIB_POSIXCHECK # undef lchmod # if HAVE_RAW_DECL_LCHMOD @@ -429,7 +475,9 @@ _GL_CXXALIAS_RPL (lstat, int, (const char *name, struct stat *buf)); # else _GL_CXXALIAS_SYS (lstat, int, (const char *name, struct stat *buf)); # endif +# if @HAVE_LSTAT@ _GL_CXXALIASWARN (lstat); +# endif #elif defined GNULIB_POSIXCHECK # undef lstat # if HAVE_RAW_DECL_LSTAT @@ -450,14 +498,18 @@ _GL_CXXALIAS_RPL (mkdir, int, (char const *name, mode_t mode)); #else /* mingw's _mkdir() function has 1 argument, but we pass 2 arguments. Additionally, it declares _mkdir (and depending on compile flags, an - alias mkdir), only in the nonstandard , which is included above. */ + alias mkdir), only in the nonstandard includes and , + which are included above. */ # if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ -static inline int +# if !GNULIB_defined_rpl_mkdir +static int rpl_mkdir (char const *name, mode_t mode) { return _mkdir (name); } +# define GNULIB_defined_rpl_mkdir 1 +# endif # if !(defined __cplusplus && defined GNULIB_NAMESPACE) # define mkdir rpl_mkdir @@ -542,7 +594,8 @@ _GL_CXXALIAS_RPL (mknod, int, (char const *file, mode_t mode, dev_t dev)); _GL_FUNCDECL_SYS (mknod, int, (char const *file, mode_t mode, dev_t dev) _GL_ARG_NONNULL ((1))); # endif -_GL_CXXALIAS_SYS (mknod, int, (char const *file, mode_t mode, dev_t dev)); +/* Need to cast, because on OSF/1 5.1, the third parameter is '...'. */ +_GL_CXXALIAS_SYS_CAST (mknod, int, (char const *file, mode_t mode, dev_t dev)); # endif _GL_CXXALIASWARN (mknod); #elif defined GNULIB_POSIXCHECK @@ -577,17 +630,59 @@ _GL_WARN_ON_USE (mknodat, "mknodat is not portable - " /* We can't use the object-like #define stat rpl_stat, because of struct stat. This means that rpl_stat will not be used if the user does (stat)(a,b). Oh well. */ -# undef stat -# ifdef _LARGE_FILES +# if defined _AIX && defined stat && defined _LARGE_FILES /* With _LARGE_FILES defined, AIX (only) defines stat to stat64, so we have to replace stat64() instead of stat(). */ -# define stat stat64 # undef stat64 # define stat64(name, st) rpl_stat (name, st) -# else /* !_LARGE_FILES */ +# elif @WINDOWS_64_BIT_ST_SIZE@ + /* Above, we define stat to _stati64. */ +# if defined __MINGW32__ && defined _stati64 +# ifndef _USE_32BIT_TIME_T + /* The system headers define _stati64 to _stat64. */ +# undef _stat64 +# define _stat64(name, st) rpl_stat (name, st) +# endif +# elif defined _MSC_VER && defined _stati64 +# ifdef _USE_32BIT_TIME_T + /* The system headers define _stati64 to _stat32i64. */ +# undef _stat32i64 +# define _stat32i64(name, st) rpl_stat (name, st) +# else + /* The system headers define _stati64 to _stat64. */ +# undef _stat64 +# define _stat64(name, st) rpl_stat (name, st) +# endif +# else +# undef _stati64 +# define _stati64(name, st) rpl_stat (name, st) +# endif +# elif defined __MINGW32__ && defined stat +# ifdef _USE_32BIT_TIME_T + /* The system headers define stat to _stat32i64. */ +# undef _stat32i64 +# define _stat32i64(name, st) rpl_stat (name, st) +# else + /* The system headers define stat to _stat64. */ +# undef _stat64 +# define _stat64(name, st) rpl_stat (name, st) +# endif +# elif defined _MSC_VER && defined stat +# ifdef _USE_32BIT_TIME_T + /* The system headers define stat to _stat32. */ +# undef _stat32 +# define _stat32(name, st) rpl_stat (name, st) +# else + /* The system headers define stat to _stat64i32. */ +# undef _stat64i32 +# define _stat64i32(name, st) rpl_stat (name, st) +# endif +# else /* !(_AIX ||__MINGW32__ || _MSC_VER) */ +# undef stat # define stat(name, st) rpl_stat (name, st) # endif /* !_LARGE_FILES */ -_GL_EXTERN_C int stat (const char *name, struct stat *buf) _GL_ARG_NONNULL ((1, 2)); +_GL_EXTERN_C int stat (const char *name, struct stat *buf) + _GL_ARG_NONNULL ((1, 2)); # endif #elif defined GNULIB_POSIXCHECK # undef stat @@ -599,7 +694,11 @@ _GL_WARN_ON_USE (stat, "stat is unportable - " #if @GNULIB_UTIMENSAT@ -# if @REPLACE_UTIMENSAT@ +/* Use the rpl_ prefix also on Solaris <= 9, because on Solaris 9 our utimensat + implementation relies on futimesat, which on Solaris 10 makes an invocation + to utimensat that is meant to invoke the libc's utimensat(), not gnulib's + utimensat(). */ +# if @REPLACE_UTIMENSAT@ || (!@HAVE_UTIMENSAT@ && defined __sun) # if !(defined __cplusplus && defined GNULIB_NAMESPACE) # undef utimensat # define utimensat rpl_utimensat @@ -618,7 +717,9 @@ _GL_FUNCDECL_SYS (utimensat, int, (int fd, char const *name, _GL_CXXALIAS_SYS (utimensat, int, (int fd, char const *name, struct timespec const times[2], int flag)); # endif +# if @HAVE_UTIMENSAT@ _GL_CXXALIASWARN (utimensat); +# endif #elif defined GNULIB_POSIXCHECK # undef utimensat # if HAVE_RAW_DECL_UTIMENSAT @@ -628,6 +729,6 @@ _GL_WARN_ON_USE (utimensat, "utimensat is not portable - " #endif -#endif /* _GL_SYS_STAT_H */ -#endif /* _GL_SYS_STAT_H */ +#endif /* _@GUARD_PREFIX@_SYS_STAT_H */ +#endif /* _@GUARD_PREFIX@_SYS_STAT_H */ #endif