delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1997/11/25/08:14:16

Date: Tue, 25 Nov 1997 08:14:06 -0500 (EST)
Message-Id: <199711251314.IAA01310@delorie.com>
From: DJ Delorie <dj AT delorie DOT com>
To: eliz AT is DOT elta DOT co DOT il
CC: djgpp-workers AT delorie DOT com
In-reply-to: <Pine.SUN.3.91.971125140021.27505O-100000@is> (message from Eli
Zaretskii on Tue, 25 Nov 1997 14:00:43 +0200 (IST))
Subject: Re: <sys/stat.h> constants

> S_ISUID is not the main problem.  The S_IFMT bits are.  Does SGI
> define these differently as well?

Differently than what?  Here's what SGI says:

#define	S_IFMT		0xF000	/* type of file */
#define	S_IFIFO		0x1000	/* fifo */
#define	S_IFCHR		0x2000	/* character special */
#define	S_IFDIR		0x4000	/* directory */
#define	S_IFNAM		0x5000  /* XENIX special named file */
#define	S_IFBLK		0x6000	/* block special */
#define	S_IFREG		0x8000	/* regular */
#define	S_IFLNK		0xA000	/* symbolic link */
#define	S_IFSOCK	0xC000	/* socket */


> I agree that such programs are broken, but given that the set of
> broken programs includes GNU cpio, I think this is well worth of
> changing unless we have grave reasons not to.  (The definition of
> ``grave reasons'' is left as an excercise to the reader ;-)

The POSIX manual defines specific numeric values that are to be stored
when certain inode types are described.  cpio must convert between the
system's symbolic constants and the defined standard numeric values
when it reads/writes the cpio archive.  Relying on the constants to
match the defined numeric values is a bug and should be fixed.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019