* m4/include_next.m4 (gl_INCLUDE_NEXT): Define and AC_SUBST
[pspp] / lib / unistd_.h
index f34bc66c1763bba7f0fa3ef91ce106c51b1b6f43..07c48778368f1d36f06a307bf11dccd22001519f 100644 (file)
 
 /* The include_next requires a split double-inclusion guard.  */
 #if @HAVE_UNISTD_H@
-# if @HAVE_INCLUDE_NEXT@
-#  include_next <unistd.h>
-# else
-#  include @ABSOLUTE_UNISTD_H@
-# endif
+# @INCLUDE_NEXT@ @NEXT_UNISTD_H@
 #endif
 
 #ifndef _GL_UNISTD_H
@@ -49,13 +45,18 @@ extern "C" {
 
 #if @GNULIB_CHOWN@
 # if @REPLACE_CHOWN@
+#  ifndef REPLACE_CHOWN
+#   define REPLACE_CHOWN 1
+#  endif
+#  if REPLACE_CHOWN
 /* Change the owner of FILE to UID (if UID is not -1) and the group of FILE
-   to GID (if GID is not -1).
+   to GID (if GID is not -1).  Follow symbolic links.
    Return 0 if successful, otherwise -1 and errno set.
    See the POSIX:2001 specification
    <http://www.opengroup.org/susv3xsh/chown.html>.  */
-#  define chown rpl_chown
+#   define chown rpl_chown
 extern int chown (const char *file, uid_t uid, gid_t gid);
+#  endif
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef chown
@@ -179,6 +180,25 @@ extern int getlogin_r (char *name, size_t size);
 #endif
 
 
+#if @GNULIB_LCHOWN@
+# if @REPLACE_LCHOWN@
+/* Change the owner of FILE to UID (if UID is not -1) and the group of FILE
+   to GID (if GID is not -1).  Do not follow symbolic links.
+   Return 0 if successful, otherwise -1 and errno set.
+   See the POSIX:2001 specification
+   <http://www.opengroup.org/susv3xsh/lchown.html>.  */
+#  define lchown rpl_lchown
+extern int lchown (char const *file, uid_t owner, gid_t group);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef lchown
+# define lchown(f,u,g) \
+    (GL_LINK_WARNING ("lchown is unportable to pre-POSIX.1-2001 " \
+                      "systems - use gnulib module lchown for portability"), \
+     lchown (f, u, g))
+#endif
+
+
 #if @GNULIB_LSEEK@
 # if @REPLACE_LSEEK@
 /* Set the offset of FD relative to SEEK_SET, SEEK_CUR, or SEEK_END.