X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Funistd.in.h;h=f191412e23ec3e0da1f49e090baf793d31ecc8be;hb=6c9f1e88ada406b65f6b10098b8c9e60c973e614;hp=d86d06ea7de921ad73e62724559d708cf965b3e1;hpb=ac181274675d799dc733b278418b2caa530e4c4d;p=gnulib.git diff --git a/lib/unistd.in.h b/lib/unistd.in.h index d86d06ea7..f191412e2 100644 --- a/lib/unistd.in.h +++ b/lib/unistd.in.h @@ -147,16 +147,13 @@ extern int chown (const char *file, uid_t uid, gid_t gid); #endif -#if @GNULIB_OPENAT@ +#if @GNULIB_FCHOWNAT@ # if @REPLACE_FCHOWNAT@ # undef fchownat # define fchownat rpl_fchownat # endif # if !@HAVE_FCHOWNAT@ || @REPLACE_FCHOWNAT@ -int fchownat (int fd, char const *file, uid_t owner, gid_t group, int flag); -# endif -# if !@HAVE_UNLINKAT@ -int unlinkat (int fd, char const *file, int flag); +extern int fchownat (int fd, char const *file, uid_t owner, gid_t group, int flag); # endif #elif defined GNULIB_POSIXCHECK # undef fchownat @@ -164,12 +161,20 @@ int unlinkat (int fd, char const *file, int flag); (GL_LINK_WARNING ("fchownat is not portable - " \ "use gnulib module openat for portability"), \ fchownat (d, n, o, g, f)) +#endif + + +#if @GNULIB_UNLINKAT@ +# if !@HAVE_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 /* @GNULIB_OPENAT@ */ +#endif #if @GNULIB_FACCESSAT@ @@ -188,18 +193,22 @@ int faccessat (int fd, char const *file, int mode, int flag); # if !@HAVE_SYMLINKAT@ int symlinkat (char const *contents, int fd, char const *file); # endif -# if !@HAVE_READLINKAT@ -ssize_t readlinkat (int fd, char const *file, char *buf, size_t len); -# 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 ("faccessat is not portable - " \ + (GL_LINK_WARNING ("readlinkat is not portable - " \ "use gnulib module symlinkat for portability"), \ readlinkat (d, n, b, l)) #endif @@ -586,11 +595,14 @@ extern int lchown (char const *file, uid_t owner, gid_t group); #if @GNULIB_LINK@ +# if @REPLACE_LINK@ +# define link rpl_link +# endif /* Create a new hard link for an existing file. Return 0 if successful, otherwise -1 and errno set. See POSIX:2001 specification . */ -# if !@HAVE_LINK@ +# if !@HAVE_LINK@ || @REPLACE_LINK@ extern int link (const char *path1, const char *path2); # endif #elif defined GNULIB_POSIXCHECK