[15047] in Athena Bugs

home help back first fref pref prev next nref lref last post

SGI lossage

daemon@ATHENA.MIT.EDU (Greg Hudson)
Tue Apr 1 22:19:56 1997

Date: Wed, 2 Apr 1997 03:19:52 GMT
From: Greg Hudson <ghudson@MIT.EDU>
To: bugs@MIT.EDU

jhawk things I should report these things to bugs, even though we
currently don't have a good way of reporting bugs to vendors when they
aren't worth the effort of calling people up and getting put on hold
and stuff.

So, the bug is in the following lines in the IRIX <sys/stat.h>:

	#define S_ISFIFO(mode)	((mode&S_IFMT) == S_IFIFO)
	#define S_ISCHR(mode)	((mode&S_IFMT) == S_IFCHR)
	#define S_ISDIR(mode)	((mode&S_IFMT) == S_IFDIR)
	#define S_ISBLK(mode)	((mode&S_IFMT) == S_IFBLK)
	#define S_ISREG(mode)	((mode&S_IFMT) == S_IFREG) 
	#define S_ISLNK(m)      (((m) & S_IFMT) == S_IFLNK)
	#define S_ISSOCK(m)     (((m) & S_IFMT) == S_IFSOCK)

There are three problems here:

	* S_ISLNK and S_ISSOCK are not POSIX-protected, and neither is
	  S_IFMT.

	* The other five macros don't parenthesis-protect the mode
	  argument.

	* There's no reason why the macros should be different from
	  each other.

The problem doesn't seem to be fixed in IRIX 6.2.

home help back first fref pref prev next nref lref last post