diff options
author | Bruno Haible <bruno@clisp.org> | 2011-12-03 14:22:09 +0100 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2011-12-03 14:22:09 +0100 |
commit | cea318a913148d825c03a4e45f4553e4cb4e2880 (patch) | |
tree | 1dbc0c8461edaa6fdb1d1afbe795672679bdad13 /lib/unistd.in.h | |
parent | 0ce62ceb71b8c4c07e23f3d51e22040c5c51a466 (diff) | |
download | gnulib-cea318a913148d825c03a4e45f4553e4cb4e2880.tar.gz |
Tweak last commit.
* lib/unistd.in.h (sethostname): Keep declarations in alphabetic order.
Fix preprocessor directives indentation. Fix typos.
* m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Keep alphabetic order.
* modules/unistd (Makefile): Likewise.
Diffstat (limited to 'lib/unistd.in.h')
-rw-r--r-- | lib/unistd.in.h | 52 |
1 files changed, 27 insertions, 25 deletions
diff --git a/lib/unistd.in.h b/lib/unistd.in.h index d01f68df7e..617eb7926e 100644 --- a/lib/unistd.in.h +++ b/lib/unistd.in.h @@ -683,31 +683,6 @@ _GL_WARN_ON_USE (getgroups, "getgroups is unportable - " # endif #endif -#if @GNULIB_SETHOSTNAME@ -/* Set the host name of the machine. - The host name may or may not be fully qualified. - - Put LEN bytes of NAME into the host name. - Return 0 if successful, otherwise, set errno and return -1 - - Platforms with no ability to set the hostname return -1 and set - errno = ENOSYS. */ -# if !@HAVE_SETHOSTNAME@ || !@HAVE_DECL_SETHOSTNAME@ -_GL_FUNCDECL_SYS (sethostname, int, (const char *name, size_t len) - _GL_ARG_NONNULL ((1))); -# endif -/* Need to cast, because on Solaris 11 2011-10, MacOS X 10.5, IRIX 6.5 - and FreeBSD 6.4 the second parameter is int. On Solaris 11 - 2011-10, the first parameter is not const. */ -_GL_CXXALIAS_SYS_CAST (sethostname, int, (const char *name, size_t len)); -_GL_CXXALIASWARN (sethostname); -#elif defined GNULIB_POSIXCHECK -# undef gethostname -# if HAVE_RAW_DECL_GETHOSTNAME -_GL_WARN_ON_USE (sethostname, "sethostname is unportable - " - "use gnulib module sethostname for portability"); -# endif -#endif #if @GNULIB_GETHOSTNAME@ /* Return the standard host name of the machine. @@ -1293,6 +1268,33 @@ _GL_WARN_ON_USE (rmdir, "rmdir is unportable - " #endif +#if @GNULIB_SETHOSTNAME@ +/* Set the host name of the machine. + The host name may or may not be fully qualified. + + Put LEN bytes of NAME into the host name. + Return 0 if successful, otherwise, set errno and return -1. + + Platforms with no ability to set the hostname return -1 and set + errno = ENOSYS. */ +# if !@HAVE_SETHOSTNAME@ || !@HAVE_DECL_SETHOSTNAME@ +_GL_FUNCDECL_SYS (sethostname, int, (const char *name, size_t len) + _GL_ARG_NONNULL ((1))); +# endif +/* Need to cast, because on Solaris 11 2011-10, MacOS X 10.5, IRIX 6.5 + and FreeBSD 6.4 the second parameter is int. On Solaris 11 + 2011-10, the first parameter is not const. */ +_GL_CXXALIAS_SYS_CAST (sethostname, int, (const char *name, size_t len)); +_GL_CXXALIASWARN (sethostname); +#elif defined GNULIB_POSIXCHECK +# undef sethostname +# if HAVE_RAW_DECL_SETHOSTNAME +_GL_WARN_ON_USE (sethostname, "sethostname is unportable - " + "use gnulib module sethostname for portability"); +# endif +#endif + + #if @GNULIB_SLEEP@ /* Pause the execution of the current thread for N seconds. Returns the number of seconds left to sleep. |