X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Funistd.in.h;h=a353b0c08de1bec023ba9f941bd4308816d1aa8c;hb=e8269e90e35140ebb75f39669d39bd021e364105;hp=af2d563321f96942b643639b2ea707502b1e9d21;hpb=d19dfc69437add5301e0e1dd28dbfda2c694cbbc;p=gnulib.git diff --git a/lib/unistd.in.h b/lib/unistd.in.h index af2d56332..a353b0c08 100644 --- a/lib/unistd.in.h +++ b/lib/unistd.in.h @@ -1,5 +1,5 @@ /* Substitute for and wrapper around . - Copyright (C) 2003-2009 Free Software Foundation, Inc. + Copyright (C) 2003-2010 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 @@ -61,10 +61,8 @@ # include #endif -#if ((@GNULIB_WRITE@ && @REPLACE_WRITE@ && @GNULIB_UNISTD_H_SIGPIPE@) \ - || (@GNULIB_READLINK@ && (!@HAVE_READLINK@ || @REPLACE_READLINK@)) \ - || (@GNULIB_READLINKAT@ && !@HAVE_READLINKAT@) \ - || defined GNULIB_POSIXCHECK) +#if (@GNULIB_WRITE@ || @GNULIB_READLINK@ || @GNULIB_READLINKAT@ \ + || @GNULIB_PREAD@ || defined GNULIB_POSIXCHECK) /* Get ssize_t. */ # include #endif @@ -478,6 +476,29 @@ extern int gethostname(char *name, size_t len) _GL_ARG_NONNULL ((1)); #endif +#if @GNULIB_GETLOGIN@ +/* Returns the user's login name, or NULL if it cannot be found. Upon error, + returns NULL with errno set. + + See . + + Most programs don't need to use this function, because the information is + available through environment variables: + ${LOGNAME-$USER} on Unix platforms, + $USERNAME on native Windows platforms. + */ +# if !@HAVE_GETLOGIN@ +extern char *getlogin (void); +# endif +#elif defined GNULIB_POSIXCHECK +# undef getlogin +# define getlogin() \ + (GL_LINK_WARNING ("getlogin is unportable - " \ + "use gnulib module getlogin for portability"), \ + getlogin ()) +#endif + + #if @GNULIB_GETLOGIN_R@ /* Copies the user's login name to NAME. The array pointed to by NAME has room for SIZE bytes. @@ -487,6 +508,11 @@ extern int gethostname(char *name, size_t len) _GL_ARG_NONNULL ((1)); provided (this case is hopefully rare but is left open by the POSIX spec). See . + + Most programs don't need to use this function, because the information is + available through environment variables: + ${LOGNAME-$USER} on Unix platforms, + $USERNAME on native Windows platforms. */ # if !@HAVE_DECL_GETLOGIN_R@ extern int getlogin_r (char *name, size_t size) _GL_ARG_NONNULL ((1)); @@ -646,7 +672,7 @@ extern int linkat (int fd1, const char *path1, int fd2, const char *path2, # endif #elif defined GNULIB_POSIXCHECK # undef linkat -# define link(f1,path1,f2,path2,f) \ +# define linkat(f1,path1,f2,path2,f) \ (GL_LINK_WARNING ("linkat is unportable - " \ "use gnulib module linkat for portability"), \ linkat (f1, path1, f2, path2,f))