summaryrefslogtreecommitdiff
path: root/gl/unistd.in.h
diff options
context:
space:
mode:
Diffstat (limited to 'gl/unistd.in.h')
-rw-r--r--gl/unistd.in.h44
1 files changed, 39 insertions, 5 deletions
diff --git a/gl/unistd.in.h b/gl/unistd.in.h
index c749cbe5e8..6936ad43ad 100644
--- a/gl/unistd.in.h
+++ b/gl/unistd.in.h
@@ -164,8 +164,27 @@ extern int fchownat (int fd, char const *file, uid_t owner, gid_t group, int fla
#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 !@HAVE_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
@@ -231,6 +250,10 @@ extern int close (int);
close (f))
#endif
+#if @REPLACE_DUP@
+# define dup rpl_dup
+extern int dup (int);
+#endif
#if @GNULIB_DUP2@
# if @REPLACE_DUP2@
@@ -312,7 +335,6 @@ extern int euidaccess (const char *filename, int mode);
#if @GNULIB_FCHDIR@
# if @REPLACE_FCHDIR@
-
/* Change the process' current working directory to the directory on which
the given file descriptor is open.
Return 0 if successful, otherwise -1 and errno set.
@@ -320,9 +342,6 @@ extern int euidaccess (const char *filename, int mode);
<http://www.opengroup.org/susv3xsh/fchdir.html>. */
extern int fchdir (int /*fd*/);
-# define dup rpl_dup
-extern int dup (int);
-
/* Gnulib internal hooks needed to maintain the fchdir metadata. */
extern int _gl_register_fd (int fd, const char *filename);
extern void _gl_unregister_fd (int fd);
@@ -672,6 +691,21 @@ extern int readlink (const char *file, char *buf, size_t bufsize);
#endif
+#if @GNULIB_RMDIR@
+# if @REPLACE_RMDIR@
+# define rmdir rpl_rmdir
+/* Remove the directory DIR. */
+extern int rmdir (char const *name);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef rmdir
+# define rmdir(n) \
+ (GL_LINK_WARNING ("rmdir is unportable - " \
+ "use gnulib module rmdir for portability"), \
+ rmdir (n))
+#endif
+
+
#if @GNULIB_SLEEP@
/* Pause the execution of the current thread for N seconds.
Returns the number of seconds left to sleep.