This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Bogue des bibliotheques C sous LINUX
- To: <jlnouzille at ifrance dot com>
- Subject: Re: Bogue des bibliotheques C sous LINUX
- From: Alexandre Oliva <aoliva at redhat dot com>
- Date: 21 Jun 2001 03:53:50 -0300
- Cc: <lea_aide at club dot voila dot fr>, <gcc at gcc dot gnu dot org>, <gnu at gnu dot org>
- Organization: GCC Team, Red Hat
- References: <200106201943.06aa@lh00.opsion.fr>
On Jun 20, 2001, <jlnouzille@ifrance.com> wrote:
> Bonjour,
Bonjour. Please forgive me for not replying in French. I can barely
read French, so my attempting to write in French would certainly be a
disaster :-)
> Correctif à faire :
> #define __S_ISTYPE(mode, mask) (((mode) & (mask)) ==
> (mask))
This wouldn't be right. Take, for example, S_IFDIR (0040000) and
S_IFLBLK (0060000): should S_ISTYPE be implemented as you suggest, a
block device would be recognized as a directory, which would be
certainly wrong. The current implementation appears to be correct:
__S_IFMT chooses the bits that are used to determine the file type, and
the various S_IS* macros compare the masked file mode with the
intended bit pattern.
The only case in which you might get wrong results, I suppose, is if
the kernel started using different bits to represent the various file
types, and you're compiling your application using kernel headers of a
different version.
--
Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist *Please* write to mailing lists, not to me