From: Ulrich Drepper Date: Mon, 5 Mar 2001 18:28:40 +0000 (+0000) Subject: (__S_TYPEISMQ, __S_TYPEISSEM, __S_TYPEISSHM): Rewrite to enforce correct X-Git-Tag: upstream/2.30~10627^2~2024 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5c4a64619959b5aa60d2ad16aebaa496881f161f;p=external%2Fglibc.git (__S_TYPEISMQ, __S_TYPEISSEM, __S_TYPEISSHM): Rewrite to enforce correct use the macros. They still always return zero. --- diff --git a/sysdeps/unix/sysv/linux/alpha/bits/stat.h b/sysdeps/unix/sysv/linux/alpha/bits/stat.h index dbb7938..60a6160 100644 --- a/sysdeps/unix/sysv/linux/alpha/bits/stat.h +++ b/sysdeps/unix/sysv/linux/alpha/bits/stat.h @@ -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. */ diff --git a/sysdeps/unix/sysv/linux/m68k/bits/stat.h b/sysdeps/unix/sysv/linux/m68k/bits/stat.h index 1676f17..f360e7f 100644 --- a/sysdeps/unix/sysv/linux/m68k/bits/stat.h +++ b/sysdeps/unix/sysv/linux/m68k/bits/stat.h @@ -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. */ diff --git a/sysdeps/unix/sysv/linux/mips/bits/stat.h b/sysdeps/unix/sysv/linux/mips/bits/stat.h index 37c303b..9210cae 100644 --- a/sysdeps/unix/sysv/linux/mips/bits/stat.h +++ b/sysdeps/unix/sysv/linux/mips/bits/stat.h @@ -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. */