Mercurial > hg > octave-nkf > gnulib-hg
changeset 12053:c86af738f753
unistd: sort replacement declarations
* lib/unistd.in.h: Sort declarations.
Signed-off-by: Eric Blake <ebb9@byu.net>
author | Eric Blake <ebb9@byu.net> |
---|---|
date | Sat, 19 Sep 2009 20:37:50 -0600 |
parents | 7891d97ab77c |
children | 1c9a8901e75c |
files | ChangeLog lib/unistd.in.h |
diffstat | 2 files changed, 94 insertions(+), 86 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2009-09-22 Eric Blake <ebb9@byu.net> + unistd: sort replacement declarations + * lib/unistd.in.h: Sort declarations. + open, openat: minor optimization * lib/open.c (open): If open succeeded, len is non-zero. * lib/openat.c (rpl_openat): Likewise.
--- a/lib/unistd.in.h +++ b/lib/unistd.in.h @@ -106,7 +106,7 @@ # define STDERR_FILENO 2 #endif -/* Ensure *_OK functions exist. */ +/* Ensure *_OK macros exist. */ #ifndef F_OK # define F_OK 0 # define X_OK 1 @@ -147,91 +147,6 @@ #endif -#if @GNULIB_FCHOWNAT@ -# if @REPLACE_FCHOWNAT@ -# undef fchownat -# define fchownat rpl_fchownat -# endif -# if !@HAVE_FCHOWNAT@ || @REPLACE_FCHOWNAT@ -extern int fchownat (int fd, char const *file, uid_t owner, gid_t group, int flag); -# endif -#elif defined GNULIB_POSIXCHECK -# undef fchownat -# define fchownat(d,n,o,g,f) \ - (GL_LINK_WARNING ("fchownat is not portable - " \ - "use gnulib module openat for portability"), \ - fchownat (d, n, o, g, f)) -#endif - - -#if @GNULIB_UNLINK@ -# if @REPLACE_UNLINK@ -# undef unlink -# define unlink rpl_unlink -extern int unlink (char const *file); -# endif -#elif defined GNULIB_POSIXCHECK -# undef unlink -# define unlink(n) \ - (GL_LINK_WARNING ("unlink is not portable - " \ - "use gnulib module unlink for portability"), \ - unlink (n)) -#endif - - -#if @GNULIB_UNLINKAT@ -# if @REPLACE_UNLINKAT@ -# undef unlinkat -# define unlinkat rpl_unlinkat -# endif -# if !@HAVE_UNLINKAT@ || @REPLACE_UNLINKAT@ -extern int unlinkat (int fd, char const *file, int flag); -# endif -#elif defined GNULIB_POSIXCHECK -# undef unlinkat -# define unlinkat(d,n,f) \ - (GL_LINK_WARNING ("unlinkat is not portable - " \ - "use gnulib module openat for portability"), \ - unlinkat (d, n, f)) -#endif - - -#if @GNULIB_FACCESSAT@ -# if !@HAVE_FACCESSAT@ -int faccessat (int fd, char const *file, int mode, int flag); -# endif -#elif defined GNULIB_POSIXCHECK -# undef faccessat -# define faccessat(d,n,m,f) \ - (GL_LINK_WARNING ("faccessat is not portable - " \ - "use gnulib module faccessat for portability"), \ - faccessat (d, n, m, f)) -#endif - -#if @GNULIB_SYMLINKAT@ -# if !@HAVE_SYMLINKAT@ -int symlinkat (char const *contents, int fd, char const *file); -# endif -#elif defined GNULIB_POSIXCHECK -# undef symlinkat -# define symlinkat(c,d,n) \ - (GL_LINK_WARNING ("symlinkat is not portable - " \ - "use gnulib module symlinkat for portability"), \ - symlinkat (c, d, n)) -#endif - -#if @GNULIB_READLINKAT@ -# if !@HAVE_READLINKAT@ -ssize_t readlinkat (int fd, char const *file, char *buf, size_t len); -# endif -#elif defined GNULIB_POSIXCHECK -# undef readlinkat -# define readlinkat(d,n,b,l) \ - (GL_LINK_WARNING ("readlinkat is not portable - " \ - "use gnulib module symlinkat for portability"), \ - readlinkat (d, n, b, l)) -#endif - #if @GNULIB_CLOSE@ # if @REPLACE_CLOSE@ /* Automatically included by modules that need a replacement for close. */ @@ -250,11 +165,13 @@ close (f)) #endif + #if @REPLACE_DUP@ # define dup rpl_dup extern int dup (int); #endif + #if @GNULIB_DUP2@ # if @REPLACE_DUP2@ # define dup2 rpl_dup2 @@ -333,6 +250,19 @@ #endif +#if @GNULIB_FACCESSAT@ +# if !@HAVE_FACCESSAT@ +int faccessat (int fd, char const *file, int mode, int flag); +# endif +#elif defined GNULIB_POSIXCHECK +# undef faccessat +# define faccessat(d,n,m,f) \ + (GL_LINK_WARNING ("faccessat is not portable - " \ + "use gnulib module faccessat for portability"), \ + faccessat (d, n, m, f)) +#endif + + #if @GNULIB_FCHDIR@ # if @REPLACE_FCHDIR@ /* Change the process' current working directory to the directory on which @@ -358,6 +288,23 @@ #endif +#if @GNULIB_FCHOWNAT@ +# if @REPLACE_FCHOWNAT@ +# undef fchownat +# define fchownat rpl_fchownat +# endif +# if !@HAVE_FCHOWNAT@ || @REPLACE_FCHOWNAT@ +extern int fchownat (int fd, char const *file, uid_t owner, gid_t group, int flag); +# endif +#elif defined GNULIB_POSIXCHECK +# undef fchownat +# define fchownat(d,n,o,g,f) \ + (GL_LINK_WARNING ("fchownat is not portable - " \ + "use gnulib module openat for portability"), \ + fchownat (d, n, o, g, f)) +#endif + + #if @GNULIB_FSYNC@ /* Synchronize changes to a file. Return 0 if successful, otherwise -1 and errno set. @@ -691,6 +638,19 @@ #endif +#if @GNULIB_READLINKAT@ +# if !@HAVE_READLINKAT@ +ssize_t readlinkat (int fd, char const *file, char *buf, size_t len); +# endif +#elif defined GNULIB_POSIXCHECK +# undef readlinkat +# define readlinkat(d,n,b,l) \ + (GL_LINK_WARNING ("readlinkat is not portable - " \ + "use gnulib module symlinkat for portability"), \ + readlinkat (d, n, b, l)) +#endif + + #if @GNULIB_RMDIR@ # if @REPLACE_RMDIR@ # define rmdir rpl_rmdir @@ -723,6 +683,51 @@ #endif +#if @GNULIB_SYMLINKAT@ +# if !@HAVE_SYMLINKAT@ +int symlinkat (char const *contents, int fd, char const *file); +# endif +#elif defined GNULIB_POSIXCHECK +# undef symlinkat +# define symlinkat(c,d,n) \ + (GL_LINK_WARNING ("symlinkat is not portable - " \ + "use gnulib module symlinkat for portability"), \ + symlinkat (c, d, n)) +#endif + + +#if @GNULIB_UNLINK@ +# if @REPLACE_UNLINK@ +# undef unlink +# define unlink rpl_unlink +extern int unlink (char const *file); +# endif +#elif defined GNULIB_POSIXCHECK +# undef unlink +# define unlink(n) \ + (GL_LINK_WARNING ("unlink is not portable - " \ + "use gnulib module unlink for portability"), \ + unlink (n)) +#endif + + +#if @GNULIB_UNLINKAT@ +# if @REPLACE_UNLINKAT@ +# undef unlinkat +# define unlinkat rpl_unlinkat +# endif +# if !@HAVE_UNLINKAT@ || @REPLACE_UNLINKAT@ +extern int unlinkat (int fd, char const *file, int flag); +# endif +#elif defined GNULIB_POSIXCHECK +# undef unlinkat +# define unlinkat(d,n,f) \ + (GL_LINK_WARNING ("unlinkat is not portable - " \ + "use gnulib module openat for portability"), \ + unlinkat (d, n, f)) +#endif + + #if @GNULIB_WRITE@ && @REPLACE_WRITE@ && @GNULIB_UNISTD_H_SIGPIPE@ /* Write up to COUNT bytes starting at BUF to file descriptor FD. See the POSIX:2001 specification