X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=lib%2Funistd.in.h;fp=lib%2Funistd.in.h;h=ae59cb2e62749b6675a135964732383b5324c7a0;hb=a8a88eddaa90432e6ec1b8d9d5c9842bc91afd1d;hp=c3af07ad2192aa65982589396b2e1bcb5db0b60d;hpb=20fcfc81ece044b8b0a6768ec6cf47be4e22a2e6;p=debian%2Fgzip diff --git a/lib/unistd.in.h b/lib/unistd.in.h index c3af07a..ae59cb2 100644 --- a/lib/unistd.in.h +++ b/lib/unistd.in.h @@ -1,5 +1,5 @@ /* Substitute for and wrapper around . - Copyright (C) 2003-2016 Free Software Foundation, Inc. + Copyright (C) 2003-2018 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 @@ -12,7 +12,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, see . */ + along with this program; if not, see . */ #ifndef _@GUARD_PREFIX@_UNISTD_H @@ -55,9 +55,13 @@ #include /* mingw doesn't define the SEEK_* or *_FILENO macros in . */ +/* MSVC declares 'unlink' in , not in . We must include + it before we #define unlink rpl_unlink. */ /* Cygwin 1.7.1 declares symlinkat in , not in . */ /* But avoid namespace pollution on glibc systems. */ #if (!(defined SEEK_CUR && defined SEEK_END && defined SEEK_SET) \ + || ((@GNULIB_UNLINK@ || defined GNULIB_POSIXCHECK) \ + && ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)) \ || ((@GNULIB_SYMLINKAT@ || defined GNULIB_POSIXCHECK) \ && defined __CYGWIN__)) \ && ! defined __GLIBC__ @@ -123,11 +127,17 @@ # include #endif -/* Get getopt(), optarg, optind, opterr, optopt. - But avoid namespace pollution on glibc systems. */ -#if @GNULIB_UNISTD_H_GETOPT@ && !defined __GLIBC__ && !defined _GL_SYSTEM_GETOPT -# define __need_getopt -# include +/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ + +/* The definition of _GL_ARG_NONNULL is copied here. */ + +/* The definition of _GL_WARN_ON_USE is copied here. */ + + +/* Get getopt(), optarg, optind, opterr, optopt. */ +#if @GNULIB_UNISTD_H_GETOPT@ && !defined _GL_SYSTEM_GETOPT +# include +# include #endif #ifndef _GL_INLINE_HEADER_BEGIN @@ -138,13 +148,6 @@ _GL_INLINE_HEADER_BEGIN # define _GL_UNISTD_INLINE _GL_INLINE #endif -/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ - -/* The definition of _GL_ARG_NONNULL is copied here. */ - -/* The definition of _GL_WARN_ON_USE is copied here. */ - - /* Hide some function declarations from . */ #if @GNULIB_GETHOSTNAME@ && @UNISTD_H_HAVE_WINSOCK2_H@ @@ -375,7 +378,7 @@ _GL_WARN_ON_USE (dup2, "dup2 is unportable - " Close NEWFD first if it is open. Return newfd if successful, otherwise -1 and errno set. See the Linux man page at - . */ + . */ # if @HAVE_DUP3@ # if !(defined __cplusplus && defined GNULIB_NAMESPACE) # define dup3 rpl_dup3 @@ -458,13 +461,25 @@ _GL_WARN_ON_USE (euidaccess, "euidaccess is unportable - " #if @GNULIB_FACCESSAT@ -# if !@HAVE_FACCESSAT@ +# if @REPLACE_FACCESSAT@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef faccessat +# define faccessat rpl_faccessat +# endif +_GL_FUNCDECL_RPL (faccessat, int, + (int fd, char const *name, int mode, int flag) + _GL_ARG_NONNULL ((2))); +_GL_CXXALIAS_RPL (faccessat, int, + (int fd, char const *name, int mode, int flag)); +# else +# if !@HAVE_FACCESSAT@ _GL_FUNCDECL_SYS (faccessat, int, (int fd, char const *file, int mode, int flag) _GL_ARG_NONNULL ((2))); -# endif +# endif _GL_CXXALIAS_SYS (faccessat, int, (int fd, char const *file, int mode, int flag)); +# endif _GL_CXXALIASWARN (faccessat); #elif defined GNULIB_POSIXCHECK # undef faccessat @@ -776,7 +791,7 @@ _GL_WARN_ON_USE (gethostname, "gethostname is unportable - " ${LOGNAME-$USER} on Unix platforms, $USERNAME on native Windows platforms. */ -# if !@HAVE_GETLOGIN@ +# if !@HAVE_DECL_GETLOGIN@ _GL_FUNCDECL_SYS (getlogin, char *, (void)); # endif _GL_CXXALIAS_SYS (getlogin, char *, (void)); @@ -1145,7 +1160,7 @@ _GL_WARN_ON_USE (pipe, "pipe is unportable - " Store the read-end as fd[0] and the write-end as fd[1]. Return 0 upon success, or -1 with errno set upon failure. See also the Linux man page at - . */ + . */ # if @HAVE_PIPE2@ # if !(defined __cplusplus && defined GNULIB_NAMESPACE) # define pipe2 rpl_pipe2 @@ -1453,6 +1468,36 @@ _GL_WARN_ON_USE (symlinkat, "symlinkat is not portable - " #endif +#if @GNULIB_TRUNCATE@ +/* Change the size of the file designated by FILENAME to become equal to LENGTH. + Return 0 if successful, otherwise -1 and errno set. + See the POSIX:2008 specification + . */ +# if @REPLACE_TRUNCATE@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef truncate +# define truncate rpl_truncate +# endif +_GL_FUNCDECL_RPL (truncate, int, (const char *filename, off_t length) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (truncate, int, (const char *filename, off_t length)); +# else +# if !@HAVE_TRUNCATE@ +_GL_FUNCDECL_SYS (truncate, int, (const char *filename, off_t length) + _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (truncate, int, (const char *filename, off_t length)); +# endif +_GL_CXXALIASWARN (truncate); +#elif defined GNULIB_POSIXCHECK +# undef truncate +# if HAVE_RAW_DECL_TRUNCATE +_GL_WARN_ON_USE (truncate, "truncate is unportable - " + "use gnulib module truncate for portability"); +# endif +#endif + + #if @GNULIB_TTYNAME_R@ /* Store at most BUFLEN characters of the pathname of the terminal FD is open on in BUF. Return 0 on success, otherwise an error number. */