X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=lib%2Funistd_.h;h=24090053103d4200f50e1fff0d0ce6d09e24a5cf;hb=20b5ea915e5041b7d27d6d4fea6fc34a1d89dc45;hp=ad1b265f49f3d526a7c3be47596c88744dc3b4af;hpb=d2d77c0eacd5e95e63cbea8abca35c70ce6a9a55;p=pspp diff --git a/lib/unistd_.h b/lib/unistd_.h index ad1b265f49..2409005310 100644 --- a/lib/unistd_.h +++ b/lib/unistd_.h @@ -16,8 +16,8 @@ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GL_UNISTD_H -#define _GL_UNISTD_H +/* The include_next requires a split double-inclusion guard. */ #if @HAVE_UNISTD_H@ # if @HAVE_INCLUDE_NEXT@ # include_next @@ -26,6 +26,9 @@ # endif #endif +#ifndef _GL_UNISTD_H +#define _GL_UNISTD_H + /* mingw doesn't define the SEEK_* macros in . */ #if !(defined SEEK_CUR && defined SEEK_END && defined SEEK_SET) # include @@ -46,13 +49,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 . */ -# 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 @@ -176,6 +184,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 + . */ +# 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. @@ -236,3 +263,4 @@ extern unsigned int sleep (unsigned int n); #endif /* _GL_UNISTD_H */ +#endif /* _GL_UNISTD_H */