X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Funistd.in.h;h=f53f34b7e525e9ab78c5afc47130c4bddbf0253e;hb=6815bc73969d38c2226cf6e3366c1e4f4f756ba0;hp=18e850fb4081b417c006f4990452392399ca1fff;hpb=18306a88dced251f99b0207f2d1108831c8203a5;p=gnulib.git diff --git a/lib/unistd.in.h b/lib/unistd.in.h index 18e850fb4..f53f34b7e 100644 --- a/lib/unistd.in.h +++ b/lib/unistd.in.h @@ -83,9 +83,10 @@ # include #endif -/* Native Windows platforms declare getcwd in +/* Native Windows platforms declare chdir, getcwd, rmdir in and/or , not in . */ -#if ((@GNULIB_GETCWD@ || defined GNULIB_POSIXCHECK) \ +#if ((@GNULIB_CHDIR@ || @GNULIB_GETCWD@ || @GNULIB_RMDIR@ \ + || defined GNULIB_POSIXCHECK) \ && ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)) # include /* mingw32, mingw64 */ # include /* mingw64, MSVC 9 */ @@ -232,6 +233,18 @@ _GL_WARN_ON_USE (access, "the access function is a security risk - " #endif +#if @GNULIB_CHDIR@ +_GL_CXXALIAS_SYS (chdir, int, (const char *file) _GL_ARG_NONNULL ((1))); +_GL_CXXALIASWARN (chdir); +#elif defined GNULIB_POSIXCHECK +# undef chdir +# if HAVE_RAW_DECL_CHDIR +_GL_WARN_ON_USE (chown, "chdir is not always in - " + "use gnulib module chdir for portability"); +# endif +#endif + + #if @GNULIB_CHOWN@ /* Change the owner of FILE to UID (if UID is not -1) and the group of FILE to GID (if GID is not -1). Follow symbolic links. @@ -288,16 +301,24 @@ _GL_WARN_ON_USE (close, "close does not portably work on sockets - " #endif -#if @REPLACE_DUP@ -# if !(defined __cplusplus && defined GNULIB_NAMESPACE) -# define dup rpl_dup -# endif +#if @GNULIB_DUP@ +# if @REPLACE_DUP@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# define dup rpl_dup +# endif _GL_FUNCDECL_RPL (dup, int, (int oldfd)); _GL_CXXALIAS_RPL (dup, int, (int oldfd)); -#else +# else _GL_CXXALIAS_SYS (dup, int, (int oldfd)); -#endif +# endif _GL_CXXALIASWARN (dup); +#elif defined GNULIB_POSIXCHECK +# undef dup +# if HAVE_RAW_DECL_DUP +_GL_WARN_ON_USE (dup, "dup is unportable - " + "use gnulib module dup for portability"); +# endif +#endif #if @GNULIB_DUP2@ @@ -1156,7 +1177,7 @@ _GL_WARN_ON_USE (pwrite, "pwrite is unportable - " /* Read up to COUNT bytes from file descriptor FD into the buffer starting at BUF. See the POSIX:2008 specification . */ -# if @REPLACE_READ@ && @GNULIB_UNISTD_H_NONBLOCKING@ +# if @REPLACE_READ@ # if !(defined __cplusplus && defined GNULIB_NAMESPACE) # undef read # define read rpl_read @@ -1428,7 +1449,7 @@ _GL_WARN_ON_USE (usleep, "usleep is unportable - " /* Write up to COUNT bytes starting at BUF to file descriptor FD. See the POSIX:2008 specification . */ -# if @REPLACE_WRITE@ && (@GNULIB_UNISTD_H_NONBLOCKING@ || @GNULIB_UNISTD_H_SIGPIPE@) +# if @REPLACE_WRITE@ # if !(defined __cplusplus && defined GNULIB_NAMESPACE) # undef write # define write rpl_write