]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
(__S_TYPEISMQ, __S_TYPEISSEM, __S_TYPEISSHM): Rewrite to enforce correct use the...
authorUlrich Drepper <drepper@redhat.com>
Mon, 5 Mar 2001 18:28:43 +0000 (18:28 +0000)
committerUlrich Drepper <drepper@redhat.com>
Mon, 5 Mar 2001 18:28:43 +0000 (18:28 +0000)
sysdeps/unix/sysv/linux/alpha/bits/stat.h
sysdeps/unix/sysv/linux/bits/stat.h
sysdeps/unix/sysv/linux/ia64/bits/stat.h
sysdeps/unix/sysv/linux/m68k/bits/stat.h
sysdeps/unix/sysv/linux/mips/bits/stat.h
sysdeps/unix/sysv/linux/powerpc/bits/stat.h
sysdeps/unix/sysv/linux/s390/bits/stat.h
sysdeps/unix/sysv/linux/sparc/bits/stat.h

index dbb79383eacddfd9ae7550773fdcedead3e695ec..60a61601e9756e8eda9c186b006e212b6f598b2a 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
+/* Copyright (C) 1996,1997,1998,1999,2000,2001 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -101,10 +101,11 @@ struct stat64
 #define        __S_IFLNK       0120000 /* Symbolic link.  */
 #define        __S_IFSOCK      0140000 /* Socket.  */
 
-/* POSIX.1b objects.  */
-#define __S_TYPEISMQ(buf) (0)
-#define __S_TYPEISSEM(buf) (0)
-#define __S_TYPEISSHM(buf) (0)
+/* POSIX.1b objects.  Note that these macros always evaluate to zero.  But
+   they do it by enforcing the correct use of the macros.  */
+#define __S_TYPEISMQ(buf)  ((buf)->st_mode - (buf)->st_mode)
+#define __S_TYPEISSEM(buf) ((buf)->st_mode - (buf)->st_mode)
+#define __S_TYPEISSHM(buf) ((buf)->st_mode - (buf)->st_mode)
 
 /* Protection bits.  */
 
index d432fc858ecc5138e4382fdcdbd45c1119b2b78f..5f17f6fe27a675eb69faebbc42977d9c95fb8ef9 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992, 95, 96, 97, 98, 99, 2000 Free Software Foundation, Inc.
+/* Copyright (C) 1992,95,96,97,98,99,2000,2001 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -118,10 +118,11 @@ struct stat64
 #define        __S_IFLNK       0120000 /* Symbolic link.  */
 #define        __S_IFSOCK      0140000 /* Socket.  */
 
-/* POSIX.1b objects.  */
-#define __S_TYPEISMQ(buf) (0)
-#define __S_TYPEISSEM(buf) (0)
-#define __S_TYPEISSHM(buf) (0)
+/* POSIX.1b objects.  Note that these macros always evaluate to zero.  But
+   they do it by enforcing the correct use of the macros.  */
+#define __S_TYPEISMQ(buf)  ((buf)->st_mode - (buf)->st_mode)
+#define __S_TYPEISSEM(buf) ((buf)->st_mode - (buf)->st_mode)
+#define __S_TYPEISSHM(buf) ((buf)->st_mode - (buf)->st_mode)
 
 /* Protection bits.  */
 
index 3d938c12286c00c2d8dddeab5230e18d5f8a752e..58452be4194cd67a44771170b8f7e6ee55d91948 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999, 2000 Free Software Foundation, Inc.
+/* Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -92,10 +92,11 @@ struct stat64
 #define        __S_IFLNK       0120000 /* Symbolic link.  */
 #define        __S_IFSOCK      0140000 /* Socket.  */
 
-/* POSIX.1b objects.  */
-#define __S_TYPEISMQ(buf) (0)
-#define __S_TYPEISSEM(buf) (0)
-#define __S_TYPEISSHM(buf) (0)
+/* POSIX.1b objects.  Note that these macros always evaluate to zero.  But
+   they do it by enforcing the correct use of the macros.  */
+#define __S_TYPEISMQ(buf)  ((buf)->st_mode - (buf)->st_mode)
+#define __S_TYPEISSEM(buf) ((buf)->st_mode - (buf)->st_mode)
+#define __S_TYPEISSHM(buf) ((buf)->st_mode - (buf)->st_mode)
 
 /* Protection bits.  */
 
index 1676f17b6225b67b8cb7b9d53eeb966062af5492..f360e7f8294a0fd253f97de7444ac364a65bfd98 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992, 95, 96, 97, 98, 99, 2000 Free Software Foundation, Inc.
+/* Copyright (C) 1992,95,96,97,98,99,2000,2001 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -118,10 +118,11 @@ struct stat64
 #define        __S_IFLNK       0120000 /* Symbolic link.  */
 #define        __S_IFSOCK      0140000 /* Socket.  */
 
-/* POSIX.1b objects.  */
-#define __S_TYPEISMQ(buf) (0)
-#define __S_TYPEISSEM(buf) (0)
-#define __S_TYPEISSHM(buf) (0)
+/* POSIX.1b objects.  Note that these macros always evaluate to zero.  But
+   they do it by enforcing the correct use of the macros.  */
+#define __S_TYPEISMQ(buf)  ((buf)->st_mode - (buf)->st_mode)
+#define __S_TYPEISSEM(buf) ((buf)->st_mode - (buf)->st_mode)
+#define __S_TYPEISSHM(buf) ((buf)->st_mode - (buf)->st_mode)
 
 /* Protection bits.  */
 
index 37c303b4d0a0a6a0e2913b62c2f83b75b784b90a..9210cae7f3bcb85db1aa1f3a93cc6ec49fd11ce3 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992, 95, 96, 97, 98, 99, 2000 Free Software Foundation, Inc.
+/* Copyright (C) 1992,95,96,97,98,99,2000,2001 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -124,10 +124,11 @@ struct stat64
 #define        __S_IFLNK       0120000 /* Symbolic link.  */
 #define        __S_IFSOCK      0140000 /* Socket.  */
 
-/* POSIX.1b objects.  */
-#define __S_TYPEISMQ(buf) (0)
-#define __S_TYPEISSEM(buf) (0)
-#define __S_TYPEISSHM(buf) (0)
+/* POSIX.1b objects.  Note that these macros always evaluate to zero.  But
+   they do it by enforcing the correct use of the macros.  */
+#define __S_TYPEISMQ(buf)  ((buf)->st_mode - (buf)->st_mode)
+#define __S_TYPEISSEM(buf) ((buf)->st_mode - (buf)->st_mode)
+#define __S_TYPEISSHM(buf) ((buf)->st_mode - (buf)->st_mode)
 
 /* Protection bits.  */
 
index 8f1dffacab9ab2ab96a27195f08187abf81fa076..f5638d522e78a76a01d53890dc0f6253f8c54a4f 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992, 95, 96, 97, 98, 99, 2000 Free Software Foundation, Inc.
+/* Copyright (C) 1992,95,96,97,98,99,2000,2001 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -113,10 +113,11 @@ struct stat64
 #define        __S_IFLNK       0120000 /* Symbolic link.  */
 #define        __S_IFSOCK      0140000 /* Socket.  */
 
-/* POSIX.1b objects.  */
-#define __S_TYPEISMQ(buf) (0)
-#define __S_TYPEISSEM(buf) (0)
-#define __S_TYPEISSHM(buf) (0)
+/* POSIX.1b objects.  Note that these macros always evaluate to zero.  But
+   they do it by enforcing the correct use of the macros.  */
+#define __S_TYPEISMQ(buf)  ((buf)->st_mode - (buf)->st_mode)
+#define __S_TYPEISSEM(buf) ((buf)->st_mode - (buf)->st_mode)
+#define __S_TYPEISSHM(buf) ((buf)->st_mode - (buf)->st_mode)
 
 /* Protection bits.  */
 
index 4d6298b1f2bdf92e2486140c9a49e97476e5d5f0..a40159b0238d273b2ec697b58e90d4b2ae6917aa 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992, 95, 96, 97, 98, 99, 2000 Free Software Foundation, Inc.
+/* Copyright (C) 1992,95,96,97,98,99,2000,2001 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -118,10 +118,11 @@ struct stat64
 #define        __S_IFLNK       0120000 /* Symbolic link.  */
 #define        __S_IFSOCK      0140000 /* Socket.  */
 
-/* POSIX.1b objects.  */
-#define __S_TYPEISMQ(buf) (0)
-#define __S_TYPEISSEM(buf) (0)
-#define __S_TYPEISSHM(buf) (0)
+/* POSIX.1b objects.  Note that these macros always evaluate to zero.  But
+   they do it by enforcing the correct use of the macros.  */
+#define __S_TYPEISMQ(buf)  ((buf)->st_mode - (buf)->st_mode)
+#define __S_TYPEISSEM(buf) ((buf)->st_mode - (buf)->st_mode)
+#define __S_TYPEISSHM(buf) ((buf)->st_mode - (buf)->st_mode)
 
 /* Protection bits.  */
 
index 7fe9d4038e5121f9e4edefea710f1e197732d066..b1a562d11641bb408af708967a4f783254104bbd 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992, 95, 96, 97, 98, 99, 2000 Free Software Foundation, Inc.
+/* Copyright (C) 1992,95,96,97,98,99,2000,2001 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -76,7 +76,7 @@ struct stat64
     __dev_t st_dev;                    /* Device.  */
 #if __WORDSIZE == 64
     unsigned short int __pad1;
-#endif    
+#endif
     __ino64_t st_ino;                  /* File serial number.  */
     __mode_t st_mode;                  /* File mode.  */
     __nlink_t st_nlink;                        /* Link count.  */
@@ -116,10 +116,11 @@ struct stat64
 #define        __S_IFLNK       0120000 /* Symbolic link.  */
 #define        __S_IFSOCK      0140000 /* Socket.  */
 
-/* POSIX.1b objects.  */
-#define __S_TYPEISMQ(buf) (0)
-#define __S_TYPEISSEM(buf) (0)
-#define __S_TYPEISSHM(buf) (0)
+/* POSIX.1b objects.  Note that these macros always evaluate to zero.  But
+   they do it by enforcing the correct use of the macros.  */
+#define __S_TYPEISMQ(buf)  ((buf)->st_mode - (buf)->st_mode)
+#define __S_TYPEISSEM(buf) ((buf)->st_mode - (buf)->st_mode)
+#define __S_TYPEISSHM(buf) ((buf)->st_mode - (buf)->st_mode)
 
 /* Protection bits.  */