From 3bebb94360f1c2333feb8d504a9fa4f96984d8b7 Mon Sep 17 00:00:00 2001 From: Andreas Rottmann Date: Mon, 14 Sep 2009 12:34:37 +0200 Subject: Imported Upstream version 0.9.1.1 --- lib/unistd.in.h | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) (limited to 'lib/unistd.in.h') diff --git a/lib/unistd.in.h b/lib/unistd.in.h index 2e42c0b8..19bf5be8 100644 --- a/lib/unistd.in.h +++ b/lib/unistd.in.h @@ -29,6 +29,9 @@ #ifndef _GL_UNISTD_H #define _GL_UNISTD_H +/* NetBSD 5.0 mis-defines NULL. Also get size_t. */ +#include + /* mingw doesn't define the SEEK_* or *_FILENO macros in . */ #if !(defined SEEK_CUR && defined SEEK_END && defined SEEK_SET) # include @@ -43,6 +46,11 @@ # include #endif +/* Get getopt(), optarg, optind, opterr, optopt. */ +#if @GNULIB_UNISTD_H_GETOPT@ +# include +#endif + #if @GNULIB_GETHOSTNAME@ /* Get all possible declarations of gethostname(). */ # if @UNISTD_H_HAVE_WINSOCK2_H@ @@ -137,7 +145,7 @@ extern int chown (const char *file, uid_t uid, gid_t gid); # define close rpl_close extern int close (int); # endif -#elif @UNISTD_H_HAVE_WINSOCK2_H@ +#elif @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@ # undef close # define close close_used_without_requesting_gnulib_module_close #elif defined GNULIB_POSIXCHECK @@ -150,10 +158,13 @@ extern int close (int); #if @GNULIB_DUP2@ -# if !@HAVE_DUP2@ +# if @REPLACE_DUP2@ +# define dup2 rpl_dup2 +# endif +# if !@HAVE_DUP2@ || @REPLACE_DUP2@ /* Copy the file descriptor OLDFD into file descriptor NEWFD. Do nothing if NEWFD = OLDFD, otherwise close NEWFD first if it is open. - Return 0 if successful, otherwise -1 and errno set. + Return newfd if successful, otherwise -1 and errno set. See the POSIX:2001 specification . */ extern int dup2 (int oldfd, int newfd); @@ -214,7 +225,11 @@ extern int fchdir (int /*fd*/); # define dup rpl_dup extern int dup (int); -# define dup2 rpl_dup2 + +# if @REPLACE_DUP2@ +# undef dup2 +# endif +# define dup2 rpl_dup2_fchdir extern int dup2 (int, int); # endif @@ -363,7 +378,6 @@ extern int gethostname(char *name, size_t len); See . */ # if !@HAVE_DECL_GETLOGIN_R@ -# include extern int getlogin_r (char *name, size_t size); # endif #elif defined GNULIB_POSIXCHECK @@ -524,7 +538,6 @@ extern int link (const char *path1, const char *path2); See the POSIX:2001 specification . */ # if !@HAVE_READLINK@ -# include extern int readlink (const char *file, char *buf, size_t bufsize); # endif #elif defined GNULIB_POSIXCHECK -- cgit v1.2.3