summaryrefslogtreecommitdiff
path: root/gl/unistd.in.h
diff options
context:
space:
mode:
authorSimon Josefsson <simon@josefsson.org>2009-09-10 08:30:04 +0200
committerSimon Josefsson <simon@josefsson.org>2009-09-10 08:30:04 +0200
commit75de900398172062f40f43a6ac72434f5685a0e4 (patch)
tree18a7958c96dd77ada3b36276811e31b2dc2fa47e /gl/unistd.in.h
parent2f7caa7fd9a7830294d20145a8a75c9308be9dd0 (diff)
downloadgnutls-75de900398172062f40f43a6ac72434f5685a0e4.tar.gz
Update gnulib files.
Diffstat (limited to 'gl/unistd.in.h')
-rw-r--r--gl/unistd.in.h80
1 files changed, 79 insertions, 1 deletions
diff --git a/gl/unistd.in.h b/gl/unistd.in.h
index 1abcf83e5e..c749cbe5e8 100644
--- a/gl/unistd.in.h
+++ b/gl/unistd.in.h
@@ -106,6 +106,15 @@
# define STDERR_FILENO 2
#endif
+/* Ensure *_OK functions exist. */
+#ifndef F_OK
+# define F_OK 0
+# define X_OK 1
+# define W_OK 2
+# define R_OK 4
+#endif
+
+
/* Declare overridden functions. */
#ifdef __cplusplus
@@ -138,6 +147,72 @@ extern int chown (const char *file, uid_t uid, gid_t gid);
#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_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
+
+
+#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. */
@@ -520,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
<http://www.opengroup.org/susv3xsh/link.html>. */
-# if !@HAVE_LINK@
+# if !@HAVE_LINK@ || @REPLACE_LINK@
extern int link (const char *path1, const char *path2);
# endif
#elif defined GNULIB_POSIXCHECK