Browse Source

Sync w/ glibc and define _STAT_VER/_MKNOD_VER to 0, else some apps will consider versioned stat/mknod in uClibc

Peter S. Mazinger 19 years ago
parent
commit
752c3935f0
1 changed files with 29 additions and 11 deletions
  1. 29 11
      include/sys/stat.h

+ 29 - 11
include/sys/stat.h

@@ -1,4 +1,4 @@
-/* Copyright (C) 1991,1992,1995-2004,2005 Free Software Foundation, Inc.
+/* Copyright (C) 1991,1992,1995-2004,2005,2006 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    This file is part of the GNU C Library.
 
 
    The GNU C Library is free software; you can redistribute it and/or
    The GNU C Library is free software; you can redistribute it and/or
@@ -228,25 +228,28 @@ extern int stat64 (__const char *__restrict __file,
 extern int fstat64 (int __fd, struct stat64 *__buf) __THROW __nonnull ((2));
 extern int fstat64 (int __fd, struct stat64 *__buf) __THROW __nonnull ((2));
 #endif
 #endif
 
 
-#if 0 /*def __USE_GNU*/
+#ifdef __USE_ATFILE
 /* Similar to stat, get the attributes for FILE and put them in BUF.
 /* Similar to stat, get the attributes for FILE and put them in BUF.
    Relative path names are interpreted relative to FD unless FD is
    Relative path names are interpreted relative to FD unless FD is
    AT_FDCWD.  */
    AT_FDCWD.  */
 # ifndef __USE_FILE_OFFSET64
 # ifndef __USE_FILE_OFFSET64
-extern int fstatat (int __fd, __const char *__file, struct stat *__buf,
+extern int fstatat (int __fd, __const char *__restrict __file,
-		    int __flag) __THROW __nonnull ((2, 3));
+		    struct stat *__restrict __buf, int __flag)
+     __THROW __nonnull ((2, 3));
 # else
 # else
 #  ifdef __REDIRECT_NTH
 #  ifdef __REDIRECT_NTH
-extern int __REDIRECT_NTH (fstatat, (int __fd, __const char *__file,
+extern int __REDIRECT_NTH (fstatat, (int __fd, __const char *__restrict __file,
-				     struct stat *__buf, int __flag),
+				     struct stat *__restrict __buf,
+				     int __flag),
 			   fstatat64) __nonnull ((2, 3));
 			   fstatat64) __nonnull ((2, 3));
 #  else
 #  else
 #   define fstatat fstatat64
 #   define fstatat fstatat64
 #  endif
 #  endif
 # endif
 # endif
 
 
-extern int fstatat64 (int __fd, __const char *__file, struct stat64 *__buf,
+extern int fstatat64 (int __fd, __const char *__restrict __file,
-		      int __flag) __THROW __nonnull ((2, 3));
+		      struct stat64 *__restrict __buf, int __flag)
+     __THROW __nonnull ((2, 3));
 #endif
 #endif
 
 
 #if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
 #if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
@@ -290,6 +293,14 @@ extern int lchmod (__const char *__file, __mode_t __mode)
 extern int fchmod (int __fd, __mode_t __mode) __THROW;
 extern int fchmod (int __fd, __mode_t __mode) __THROW;
 #endif
 #endif
 
 
+#ifdef __USE_ATFILE
+/* Set file access permissions of FILE relative to
+   the directory FD is open on.  */
+extern int fchmodat (int __fd, __const char *__file, __mode_t mode, int __flag)
+     __THROW __nonnull ((2)) __wur;
+#endif /* Use ATFILE.  */
+
+
 
 
 /* Set the file creation mask of the current process to MASK,
 /* Set the file creation mask of the current process to MASK,
    and return the old creation mask.  */
    and return the old creation mask.  */
@@ -305,7 +316,7 @@ extern __mode_t getumask (void) __THROW;
 extern int mkdir (__const char *__path, __mode_t __mode)
 extern int mkdir (__const char *__path, __mode_t __mode)
      __THROW __nonnull ((1));
      __THROW __nonnull ((1));
 
 
-#if 0 /*def __USE_GNU*/
+#ifdef __USE_ATFILE
 /* Like mkdir, create a new directory with permission bits MODE.  But
 /* Like mkdir, create a new directory with permission bits MODE.  But
    interpret relative PATH names relative to the directory associated
    interpret relative PATH names relative to the directory associated
    with FD.  */
    with FD.  */
@@ -321,7 +332,7 @@ extern int mknod (__const char *__path, __mode_t __mode, __dev_t __dev)
      __THROW __nonnull ((1));
      __THROW __nonnull ((1));
 #endif
 #endif
 
 
-#if 0 /*def __USE_GNU*/
+#ifdef __USE_ATFILE
 /* Like mknod, create a new device file with permission bits MODE and
 /* Like mknod, create a new device file with permission bits MODE and
    device number DEV.  But interpret relative PATH names relative to
    device number DEV.  But interpret relative PATH names relative to
    the directory associated with FD.  */
    the directory associated with FD.  */
@@ -334,7 +345,7 @@ extern int mknodat (int __fd, __const char *__path, __mode_t __mode,
 extern int mkfifo (__const char *__path, __mode_t __mode)
 extern int mkfifo (__const char *__path, __mode_t __mode)
      __THROW __nonnull ((1));
      __THROW __nonnull ((1));
 
 
-#if 0 /*def __USE_GNU*/
+#ifdef __USE_ATFILE
 /* Like mkfifo, create a new FIFO with permission bits MODE.  But
 /* Like mkfifo, create a new FIFO with permission bits MODE.  But
    interpret relative PATH names relative to the directory associated
    interpret relative PATH names relative to the directory associated
    with FD.  */
    with FD.  */
@@ -342,6 +353,13 @@ extern int mkfifoat (int __fd, __const char *__path, __mode_t __mode)
      __THROW __nonnull ((2));
      __THROW __nonnull ((2));
 #endif
 #endif
 
 
+/* on uClibc we have unversioned struct stat and mknod.
+ * bits/stat.h is filled with wrong info, so we undo it here.  */
+#undef _STAT_VER
+#define _STAT_VER 0
+#undef _MKNOD_VER
+#define _MKNOD_VER 0
+
 __END_DECLS
 __END_DECLS