diff options
Diffstat (limited to 'lib/unistd.in.h')
-rw-r--r-- | lib/unistd.in.h | 349 |
1 files changed, 258 insertions, 91 deletions
diff --git a/lib/unistd.in.h b/lib/unistd.in.h index b5e7aaef7d6..5e9b47d981e 100644 --- a/lib/unistd.in.h +++ b/lib/unistd.in.h @@ -287,7 +287,7 @@ _GL_WARN_ON_USE (access, "access does not always support X_OK - " "also, this function is a security risk - " "use the gnulib module faccessat instead"); # endif -#else +#elif @GNULIB_MDA_ACCESS@ /* On native Windows, map 'access' to '_access', so that -loldnames is not required. In C++ with GNULIB_NAMESPACE, avoid differences between platforms by defining GNULIB_NAMESPACE::access always. */ @@ -321,7 +321,7 @@ _GL_CXXALIASWARN (chdir); _GL_WARN_ON_USE (chown, "chdir is not always in <unistd.h> - " "use gnulib module chdir for portability"); # endif -#else +#elif @GNULIB_MDA_CHDIR@ /* On native Windows, map 'chdir' to '_chdir', so that -loldnames is not required. In C++ with GNULIB_NAMESPACE, avoid differences between platforms by defining GNULIB_NAMESPACE::chdir always. */ @@ -397,7 +397,7 @@ _GL_CXXALIASWARN (close); /* Assume close is always declared. */ _GL_WARN_ON_USE (close, "close does not portably work on sockets - " "use gnulib module close for portability"); -#else +#elif @GNULIB_MDA_CLOSE@ /* On native Windows, map 'close' to '_close', so that -loldnames is not required. In C++ with GNULIB_NAMESPACE, avoid differences between platforms by defining GNULIB_NAMESPACE::close always. */ @@ -456,7 +456,7 @@ _GL_CXXALIASWARN (dup); _GL_WARN_ON_USE (dup, "dup is unportable - " "use gnulib module dup for portability"); # endif -#else +#elif @GNULIB_MDA_DUP@ /* On native Windows, map 'dup' to '_dup', so that -loldnames is not required. In C++ with GNULIB_NAMESPACE, avoid differences between platforms by defining GNULIB_NAMESPACE::dup always. */ @@ -501,7 +501,7 @@ _GL_CXXALIASWARN (dup2); _GL_WARN_ON_USE (dup2, "dup2 is unportable - " "use gnulib module dup2 for portability"); # endif -#else +#elif @GNULIB_MDA_DUP2@ /* On native Windows, map 'dup2' to '_dup2', so that -loldnames is not required. In C++ with GNULIB_NAMESPACE, avoid differences between platforms by defining GNULIB_NAMESPACE::dup2 always. */ @@ -615,116 +615,279 @@ _GL_WARN_ON_USE (euidaccess, "euidaccess is unportable - " #endif +#if @GNULIB_EXECL@ +# if @REPLACE_EXECL@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef execl +# define execl rpl_execl +# endif +_GL_FUNCDECL_RPL (execl, int, (const char *program, const char *arg, ...) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (execl, int, (const char *program, const char *arg, ...)); +# else +_GL_CXXALIAS_SYS (execl, int, (const char *program, const char *arg, ...)); +# endif +_GL_CXXALIASWARN (execl); +#elif defined GNULIB_POSIXCHECK +# undef execl +# if HAVE_RAW_DECL_EXECL +_GL_WARN_ON_USE (execl, "execl behaves very differently on mingw - " + "use gnulib module execl for portability"); +# endif +#elif @GNULIB_MDA_EXECL@ /* On native Windows, map 'execl' to '_execl', so that -loldnames is not required. In C++ with GNULIB_NAMESPACE, avoid differences between platforms by defining GNULIB_NAMESPACE::execl always. */ -#if defined _WIN32 && !defined __CYGWIN__ -# if !(defined __cplusplus && defined GNULIB_NAMESPACE) -# undef execl -# define execl _execl -# endif +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef execl +# define execl _execl +# endif _GL_CXXALIAS_MDA (execl, intptr_t, (const char *program, const char *arg, ...)); -#else +# else _GL_CXXALIAS_SYS (execl, int, (const char *program, const char *arg, ...)); -#endif +# endif _GL_CXXALIASWARN (execl); +#endif +#if @GNULIB_EXECLE@ +# if @REPLACE_EXECLE@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef execle +# define execle rpl_execle +# endif +_GL_FUNCDECL_RPL (execle, int, (const char *program, const char *arg, ...) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (execle, int, (const char *program, const char *arg, ...)); +# else +_GL_CXXALIAS_SYS (execle, int, (const char *program, const char *arg, ...)); +# endif +_GL_CXXALIASWARN (execle); +#elif defined GNULIB_POSIXCHECK +# undef execle +# if HAVE_RAW_DECL_EXECLE +_GL_WARN_ON_USE (execle, "execle behaves very differently on mingw - " + "use gnulib module execle for portability"); +# endif +#elif @GNULIB_MDA_EXECLE@ /* On native Windows, map 'execle' to '_execle', so that -loldnames is not required. In C++ with GNULIB_NAMESPACE, avoid differences between platforms by defining GNULIB_NAMESPACE::execle always. */ -#if defined _WIN32 && !defined __CYGWIN__ -# if !(defined __cplusplus && defined GNULIB_NAMESPACE) -# undef execle -# define execle _execle -# endif -_GL_CXXALIAS_MDA (execle, intptr_t, (const char *program, const char *arg, ...)); -#else +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef execle +# define execle _execle +# endif +_GL_CXXALIAS_MDA (execle, intptr_t, + (const char *program, const char *arg, ...)); +# else _GL_CXXALIAS_SYS (execle, int, (const char *program, const char *arg, ...)); -#endif +# endif _GL_CXXALIASWARN (execle); +#endif +#if @GNULIB_EXECLP@ +# if @REPLACE_EXECLP@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef execlp +# define execlp rpl_execlp +# endif +_GL_FUNCDECL_RPL (execlp, int, (const char *program, const char *arg, ...) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (execlp, int, (const char *program, const char *arg, ...)); +# else +_GL_CXXALIAS_SYS (execlp, int, (const char *program, const char *arg, ...)); +# endif +_GL_CXXALIASWARN (execlp); +#elif defined GNULIB_POSIXCHECK +# undef execlp +# if HAVE_RAW_DECL_EXECLP +_GL_WARN_ON_USE (execlp, "execlp behaves very differently on mingw - " + "use gnulib module execlp for portability"); +# endif +#elif @GNULIB_MDA_EXECLP@ /* On native Windows, map 'execlp' to '_execlp', so that -loldnames is not required. In C++ with GNULIB_NAMESPACE, avoid differences between platforms by defining GNULIB_NAMESPACE::execlp always. */ -#if defined _WIN32 && !defined __CYGWIN__ -# if !(defined __cplusplus && defined GNULIB_NAMESPACE) -# undef execlp -# define execlp _execlp -# endif -_GL_CXXALIAS_MDA (execlp, intptr_t, (const char *program, const char *arg, ...)); -#else +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef execlp +# define execlp _execlp +# endif +_GL_CXXALIAS_MDA (execlp, intptr_t, + (const char *program, const char *arg, ...)); +# else _GL_CXXALIAS_SYS (execlp, int, (const char *program, const char *arg, ...)); -#endif +# endif _GL_CXXALIASWARN (execlp); +#endif +#if @GNULIB_EXECV@ +# if @REPLACE_EXECV@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef execv +# define execv rpl_execv +# endif +_GL_FUNCDECL_RPL (execv, int, (const char *program, char * const *argv) + _GL_ARG_NONNULL ((1, 2))); +_GL_CXXALIAS_RPL (execv, int, (const char *program, char * const *argv)); +# else +_GL_CXXALIAS_SYS (execv, int, (const char *program, char * const *argv)); +# endif +_GL_CXXALIASWARN (execv); +#elif defined GNULIB_POSIXCHECK +# undef execv +# if HAVE_RAW_DECL_EXECV +_GL_WARN_ON_USE (execv, "execv behaves very differently on mingw - " + "use gnulib module execv for portability"); +# endif +#elif @GNULIB_MDA_EXECV@ /* On native Windows, map 'execv' to '_execv', so that -loldnames is not required. In C++ with GNULIB_NAMESPACE, avoid differences between platforms by defining GNULIB_NAMESPACE::execv always. */ -#if defined _WIN32 && !defined __CYGWIN__ -# if !(defined __cplusplus && defined GNULIB_NAMESPACE) -# undef execv -# define execv _execv -# endif -_GL_CXXALIAS_MDA (execv, intptr_t, - (const char *program, const char * const *argv)); -#else +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef execv +# define execv _execv +# endif +_GL_CXXALIAS_MDA_CAST (execv, intptr_t, + (const char *program, char * const *argv)); +# else _GL_CXXALIAS_SYS (execv, int, (const char *program, char * const *argv)); -#endif +# endif _GL_CXXALIASWARN (execv); +#endif +#if @GNULIB_EXECVE@ +# if @REPLACE_EXECVE@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef execve +# define execve rpl_execve +# endif +_GL_FUNCDECL_RPL (execve, int, + (const char *program, char * const *argv, char * const *env) + _GL_ARG_NONNULL ((1, 2))); +_GL_CXXALIAS_RPL (execve, int, + (const char *program, char * const *argv, char * const *env)); +# else +_GL_CXXALIAS_SYS (execve, int, + (const char *program, char * const *argv, char * const *env)); +# endif +_GL_CXXALIASWARN (execve); +#elif defined GNULIB_POSIXCHECK +# undef execve +# if HAVE_RAW_DECL_EXECVE +_GL_WARN_ON_USE (execve, "execve behaves very differently on mingw - " + "use gnulib module execve for portability"); +# endif +#elif @GNULIB_MDA_EXECVE@ /* On native Windows, map 'execve' to '_execve', so that -loldnames is not required. In C++ with GNULIB_NAMESPACE, avoid differences between platforms by defining GNULIB_NAMESPACE::execve always. */ -#if defined _WIN32 && !defined __CYGWIN__ -# if !(defined __cplusplus && defined GNULIB_NAMESPACE) -# undef execve -# define execve _execve -# endif -_GL_CXXALIAS_MDA (execve, intptr_t, - (const char *program, const char * const *argv, - const char * const *env)); -#else +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef execve +# define execve _execve +# endif +_GL_CXXALIAS_MDA_CAST (execve, intptr_t, + (const char *program, char * const *argv, + char * const *env)); +# else _GL_CXXALIAS_SYS (execve, int, (const char *program, char * const *argv, char * const *env)); -#endif +# endif _GL_CXXALIASWARN (execve); +#endif +#if @GNULIB_EXECVP@ +# if @REPLACE_EXECVP@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef execvp +# define execvp rpl_execvp +# endif +_GL_FUNCDECL_RPL (execvp, int, (const char *program, char * const *argv) + _GL_ARG_NONNULL ((1, 2))); +_GL_CXXALIAS_RPL (execvp, int, (const char *program, char * const *argv)); +# else +_GL_CXXALIAS_SYS (execvp, int, (const char *program, char * const *argv)); +# endif +_GL_CXXALIASWARN (execvp); +#elif defined GNULIB_POSIXCHECK +# undef execvp +# if HAVE_RAW_DECL_EXECVP +_GL_WARN_ON_USE (execvp, "execvp behaves very differently on mingw - " + "use gnulib module execvp for portability"); +# endif +#elif @GNULIB_MDA_EXECVP@ /* On native Windows, map 'execvp' to '_execvp', so that -loldnames is not required. In C++ with GNULIB_NAMESPACE, avoid differences between platforms by defining GNULIB_NAMESPACE::execvp always. */ -#if defined _WIN32 && !defined __CYGWIN__ -# if !(defined __cplusplus && defined GNULIB_NAMESPACE) -# undef execvp -# define execvp _execvp -# endif -_GL_CXXALIAS_MDA (execvp, intptr_t, - (const char *program, const char * const *argv)); -#else +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef execvp +# define execvp _execvp +# endif +_GL_CXXALIAS_MDA_CAST (execvp, intptr_t, + (const char *program, char * const *argv)); +# else _GL_CXXALIAS_SYS (execvp, int, (const char *program, char * const *argv)); -#endif +# endif _GL_CXXALIASWARN (execvp); +#endif +#if @GNULIB_EXECVPE@ +# if @REPLACE_EXECVPE@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef execvpe +# define execvpe rpl_execvpe +# endif +_GL_FUNCDECL_RPL (execvpe, int, + (const char *program, char * const *argv, char * const *env) + _GL_ARG_NONNULL ((1, 2))); +_GL_CXXALIAS_RPL (execvpe, int, + (const char *program, char * const *argv, char * const *env)); +# else +# if !@HAVE_DECL_EXECVPE@ +_GL_FUNCDECL_SYS (execvpe, int, + (const char *program, char * const *argv, char * const *env) + _GL_ARG_NONNULL ((1, 2))); +# endif +_GL_CXXALIAS_SYS (execvpe, int, + (const char *program, char * const *argv, char * const *env)); +# endif +_GL_CXXALIASWARN (execvpe); +#elif defined GNULIB_POSIXCHECK +# undef execvpe +# if HAVE_RAW_DECL_EXECVPE +_GL_WARN_ON_USE (execvpe, "execvpe behaves very differently on mingw - " + "use gnulib module execvpe for portability"); +# endif +#elif @GNULIB_MDA_EXECVPE@ /* On native Windows, map 'execvpe' to '_execvpe', so that -loldnames is not required. In C++ with GNULIB_NAMESPACE, avoid differences between platforms by defining GNULIB_NAMESPACE::execvpe on all platforms that have it. */ -#if defined _WIN32 && !defined __CYGWIN__ -# if !(defined __cplusplus && defined GNULIB_NAMESPACE) -# undef execvpe -# define execvpe _execvpe -# endif -_GL_CXXALIAS_MDA (execvpe, intptr_t, - (const char *program, const char * const *argv, - const char * const *env)); -#else -# if @HAVE_DECL_EXECVPE@ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef execvpe +# define execvpe _execvpe +# endif +_GL_CXXALIAS_MDA_CAST (execvpe, intptr_t, + (const char *program, char * const *argv, + char * const *env)); +# elif @HAVE_EXECVPE@ +# if !@HAVE_DECL_EXECVPE@ +_GL_FUNCDECL_SYS (execvpe, int, + (const char *program, char * const *argv, char * const *env) + _GL_ARG_NONNULL ((1, 2))); +# endif _GL_CXXALIAS_SYS (execvpe, int, (const char *program, char * const *argv, char * const *env)); # endif -#endif -#if (defined _WIN32 && !defined __CYGWIN__) || @HAVE_DECL_EXECVPE@ +# if (defined _WIN32 && !defined __CYGWIN__) || @HAVE_EXECVPE@ _GL_CXXALIASWARN (execvpe); +# endif #endif @@ -815,7 +978,7 @@ _GL_CXXALIASWARN (fchownat); # undef fchownat # if HAVE_RAW_DECL_FCHOWNAT _GL_WARN_ON_USE (fchownat, "fchownat is not portable - " - "use gnulib module openat for portability"); + "use gnulib module fchownat for portability"); # endif #endif @@ -921,7 +1084,7 @@ _GL_CXXALIASWARN (getcwd); _GL_WARN_ON_USE (getcwd, "getcwd is unportable - " "use gnulib module getcwd for portability"); # endif -#else +#elif @GNULIB_MDA_GETCWD@ /* On native Windows, map 'getcwd' to '_getcwd', so that -loldnames is not required. In C++ with GNULIB_NAMESPACE, avoid differences between platforms by defining GNULIB_NAMESPACE::getcwd always. */ @@ -1271,19 +1434,21 @@ _GL_WARN_ON_USE (getpass, "getpass is unportable - " #endif +#if @GNULIB_MDA_GETPID@ /* On native Windows, map 'getpid' to '_getpid', so that -loldnames is not required. In C++ with GNULIB_NAMESPACE, avoid differences between platforms by defining GNULIB_NAMESPACE::getpid always. */ -#if defined _WIN32 && !defined __CYGWIN__ -# if !(defined __cplusplus && defined GNULIB_NAMESPACE) -# undef getpid -# define getpid _getpid -# endif +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef getpid +# define getpid _getpid +# endif _GL_CXXALIAS_MDA (getpid, int, (void)); -#else +# else _GL_CXXALIAS_SYS (getpid, pid_t, (void)); -#endif +# endif _GL_CXXALIASWARN (getpid); +#endif #if @GNULIB_GETUSERSHELL@ @@ -1374,7 +1539,7 @@ _GL_CXXALIASWARN (isatty); _GL_WARN_ON_USE (isatty, "isatty has portability problems on native Windows - " "use gnulib module isatty for portability"); # endif -#else +#elif @GNULIB_MDA_ISATTY@ /* On native Windows, map 'isatty' to '_isatty', so that -loldnames is not required. In C++ with GNULIB_NAMESPACE, avoid differences between platforms by defining GNULIB_NAMESPACE::isatty always. */ @@ -1515,7 +1680,7 @@ _GL_CXXALIASWARN (lseek); _GL_WARN_ON_USE (lseek, "lseek does not fail with ESPIPE on pipes on some " "systems - use gnulib module lseek for portability"); # endif -#else +#elif @GNULIB_MDA_LSEEK@ /* On native Windows, map 'lseek' to '_lseek', so that -loldnames is not required. In C++ with GNULIB_NAMESPACE, avoid differences between platforms by defining GNULIB_NAMESPACE::lseek always. */ @@ -1671,7 +1836,7 @@ _GL_CXXALIAS_MDA (read, ssize_t, (int fd, void *buf, size_t count)); _GL_CXXALIAS_SYS (read, ssize_t, (int fd, void *buf, size_t count)); # endif _GL_CXXALIASWARN (read); -#else +#elif @GNULIB_MDA_READ@ /* On native Windows, map 'read' to '_read', so that -loldnames is not required. In C++ with GNULIB_NAMESPACE, avoid differences between platforms by defining GNULIB_NAMESPACE::read always. */ @@ -1787,7 +1952,7 @@ _GL_CXXALIASWARN (rmdir); _GL_WARN_ON_USE (rmdir, "rmdir is unportable - " "use gnulib module rmdir for portability"); # endif -#else +#elif @GNULIB_MDA_RMDIR@ /* On native Windows, map 'rmdir' to '_rmdir', so that -loldnames is not required. In C++ with GNULIB_NAMESPACE, avoid differences between platforms by defining GNULIB_NAMESPACE::rmdir always. */ @@ -1859,19 +2024,21 @@ _GL_WARN_ON_USE (sleep, "sleep is unportable - " #endif +#if @GNULIB_MDA_SWAB@ /* On native Windows, map 'swab' to '_swab', so that -loldnames is not required. In C++ with GNULIB_NAMESPACE, avoid differences between platforms by defining GNULIB_NAMESPACE::creat always. */ -#if defined _WIN32 && !defined __CYGWIN__ -# if !(defined __cplusplus && defined GNULIB_NAMESPACE) -# undef swab -# define swab _swab -# endif +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef swab +# define swab _swab +# endif _GL_CXXALIAS_MDA (swab, void, (char *from, char *to, int n)); -#else +# else _GL_CXXALIAS_SYS (swab, void, (const void *from, void *to, ssize_t n)); -#endif +# endif _GL_CXXALIASWARN (swab); +#endif #if @GNULIB_SYMLINK@ @@ -2014,7 +2181,7 @@ _GL_CXXALIASWARN (unlink); _GL_WARN_ON_USE (unlink, "unlink is not portable - " "use gnulib module unlink for portability"); # endif -#else +#elif @GNULIB_MDA_UNLINK@ /* On native Windows, map 'unlink' to '_unlink', so that -loldnames is not required. In C++ with GNULIB_NAMESPACE, avoid differences between platforms by defining GNULIB_NAMESPACE::unlink always. */ @@ -2052,7 +2219,7 @@ _GL_CXXALIASWARN (unlinkat); # undef unlinkat # if HAVE_RAW_DECL_UNLINKAT _GL_WARN_ON_USE (unlinkat, "unlinkat is not portable - " - "use gnulib module openat for portability"); + "use gnulib module unlinkat for portability"); # endif #endif @@ -2109,7 +2276,7 @@ _GL_CXXALIAS_MDA (write, ssize_t, (int fd, const void *buf, size_t count)); _GL_CXXALIAS_SYS (write, ssize_t, (int fd, const void *buf, size_t count)); # endif _GL_CXXALIASWARN (write); -#else +#elif @GNULIB_MDA_WRITE@ /* On native Windows, map 'write' to '_write', so that -loldnames is not required. In C++ with GNULIB_NAMESPACE, avoid differences between platforms by defining GNULIB_NAMESPACE::write always. */ |