]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
hurd: fix f?chflags prototypes, declare them and their flags
authorSamuel Thibault <samuel.thibault@ens-lyon.org>
Sat, 7 Feb 2015 20:56:15 +0000 (21:56 +0100)
committerSamuel Thibault <samuel.thibault@ens-lyon.org>
Sat, 7 Feb 2015 20:56:15 +0000 (21:56 +0100)
ChangeLog
misc/chflags.c
misc/fchflags.c
sysdeps/mach/hurd/bits/stat.h
sysdeps/mach/hurd/chflags.c
sysdeps/mach/hurd/fchflags.c

index 331b1dc347aa2f732506e7e12335d350b4e70b4e..0474b0f0355de4d598e2ce15dacfc92d3150b7ff 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,16 @@
 
        * sysdeps/pthread/aio_misc.c [!AIO_PRIO_DELTA_MAX]: Do not check
        priority against unexistent AIO_PRIO_DELTA_MAX.
+       * misc/chflags.c (chflags): Set flags parameter type to unsigned long
+       instead of int.
+       * misc/fchflags.c (fchflags): Likewise.
+       * sysdeps/mach/hurd/chflags.c (chflags): Likewise.
+       * sysdeps/mach/hurd/fchflags.c (fchflags): Likewise.
+       * sysdeps/mach/hurd/bits/stat.h [__USE_MISC] (UF_SETTABLE, UF_NODUMP,
+       UF_IMMUTABLE, UF_APPEND, UF_OPAQUE, UF_NOUNLINK, SF_SETTABLE,
+       SF_ARCHIVED, SF_IMMUTABLE, SF_APPEND, SF_NOUNLINK, SF_SNAPSHOT):
+       Declare macros.
+       [__USE_MISC] (chflags, fchflags): Declare functions.
 
 2015-02-06  Roland McGrath  <roland@hack.frob.com>
 
index 48a9ce0c67f8e499e70e8043ff5cdafc855de8f8..241be86be7e46ac348ba72a23f4ad0cd00fe7506 100644 (file)
 
 /* Change the flags of FILE to FLAGS.  */
 
-int chflags (const char *file, int flags) __THROW;
+int chflags (const char *file, unsigned long int flags) __THROW;
 
 int
 chflags (file, flags)
      const char *file;
-     int flags;
+     unsigned long int flags;
 {
   if (file == NULL)
     {
index 32234613d9ce7272f8ad42af2b6765554c41a94c..b9f267583bdd808a78e8e674f7a74079b219be41 100644 (file)
 
 /* Change the flags of the file referenced by FD to FLAGS.  */
 
-int fchflags (int fd, int flags) __THROW;
+int fchflags (int fd, unsigned long int flags) __THROW;
 
 int
 fchflags (fd, flags)
      int fd;
-     int flags;
+     unsigned long int flags;
 {
   if (fd < 0)
     {
index 6f9245742e0a4c691d060eeef1d903861ea9ce61..4d4bae43916b946549af6ba52d14961128919ed0 100644 (file)
@@ -222,9 +222,37 @@ struct stat64
                           S_IUSEUNK|S_IUNKNOWN|07777))
 #endif
 
-/* Default file creation mask (umask).  */
 #ifdef __USE_MISC
+/* Default file creation mask (umask).  */
 # define CMASK         0022
+
+/* Definitions of flags stored in file flags word.  */
+
+/* Super-user and owner changeable flags.  */
+# define UF_SETTABLE   0x0000ffff      /* mask of owner changeable flags */
+# define UF_NODUMP     0x00000001      /* do not dump file */
+# define UF_IMMUTABLE  0x00000002      /* file may not be changed */
+# define UF_APPEND     0x00000004      /* writes to file may only append */
+# define UF_OPAQUE     0x00000008      /* directory is opaque wrt. union */
+# define UF_NOUNLINK   0x00000010      /* file may not be removed or renamed */
+
+/* Super-user changeable flags.  */
+# define SF_SETTABLE   0xffff0000      /* mask of superuser changeable flags */
+# define SF_ARCHIVED   0x00010000      /* file is archived */
+# define SF_IMMUTABLE  0x00020000      /* file may not be changed */
+# define SF_APPEND     0x00040000      /* writes to file may only append */
+# define SF_NOUNLINK   0x00100000      /* file may not be removed or renamed */
+# define SF_SNAPSHOT   0x00200000      /* snapshot inode */
+
+__BEGIN_DECLS
+
+/* Set file flags for FILE to FLAGS.  */
+extern int chflags (__const char *__file, unsigned long int __flags) __THROW;
+
+/* Set file flags of the file referred to by FD to FLAGS.  */
+extern int fchflags (int __fd, unsigned long int __flags) __THROW;
+
+__END_DECLS
 #endif
 
 #endif /* bits/stat.h */
index 07a8b1fe0f184b74f28c27cdf8240193c58755e0..f088f9b4378d64d67aa43d256f83d69e32946c79 100644 (file)
@@ -24,7 +24,7 @@
 
 /* XXX shouldn't this be __chflags? */
 int
-chflags (const char *file, int flags)
+chflags (const char *file, unsigned long int flags)
 {
   error_t err;
   file_t port = __file_name_lookup (file, 0, 0);
index d665e6671c97129e76d55a668fd55e90201be9bd..841d9df56e663c8f522a7e3864f3bcb0f18e700b 100644 (file)
@@ -25,7 +25,7 @@
 
 /* XXX should be __fchflags? */
 int
-fchflags (int fd, int flags)
+fchflags (int fd, unsigned long int flags)
 {
   error_t err;