From owner-freebsd-hackers Tue Aug 19 23:51:55 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id XAA03692 for hackers-outgoing; Tue, 19 Aug 1997 23:51:55 -0700 (PDT) Received: from sax.sax.de (sax.sax.de [193.175.26.33]) by hub.freebsd.org (8.8.5/8.8.5) with SMTP id XAA03682 for ; Tue, 19 Aug 1997 23:51:52 -0700 (PDT) Received: (from uucp@localhost) by sax.sax.de (8.6.12/8.6.12-s1) with UUCP id IAA27971; Wed, 20 Aug 1997 08:51:46 +0200 Received: (from j@localhost) by uriah.heep.sax.de (8.8.7/8.8.5) id IAA24866; Wed, 20 Aug 1997 08:35:48 +0200 (MET DST) Message-ID: <19970820083548.RY05593@uriah.heep.sax.de> Date: Wed, 20 Aug 1997 08:35:48 +0200 From: j@uriah.heep.sax.de (J Wunsch) To: hackers@FreeBSD.ORG Cc: abelits@phobos.illtel.denver.co.us (Alex Belits) Subject: Re: S_ISFIFO and S_ISSOCK References: X-Mailer: Mutt 0.60_p2-3,5,8-9 Mime-Version: 1.0 X-Phone: +49-351-2012 669 X-PGP-Fingerprint: DC 47 E6 E4 FF A6 E9 8F 93 21 E0 7D F9 12 D6 4E Reply-To: joerg_wunsch@uriah.heep.sax.de (Joerg Wunsch) In-Reply-To: ; from Alex Belits on Aug 19, 1997 20:47:00 -0700 Sender: owner-freebsd-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk As Alex Belits wrote: > In other words, fifo and socket have different flags, but checks for > them treat them as one? You ought to use up-to-date versions of the system... #define S_ISFIFO(m) (((m) & 0170000) == 0010000) /* fifo or socket */ #ifndef _POSIX_SOURCE #define S_ISLNK(m) (((m) & 0170000) == 0120000) /* symbolic link */ #define S_ISSOCK(m) (((m) & 0170000) == 0140000) /* socket */ #define S_ISWHT(m) (((m) & 0170000) == 0160000) /* whiteout */ #endif Well, the first comment is still wrong. > And it's mentioned that S_IFIFO is set for named > pipes while in fact it's set for both anonymous and named ones, while > S_IFSOCK is set for sockets only. 4.4BSD unnamed pipes were sockets. John Dyson rewrote the pipe code later, so they are no longer sockets now. -- cheers, J"org joerg_wunsch@uriah.heep.sax.de -- http://www.sax.de/~joerg/ -- NIC: JW11-RIPE Never trust an operating system you don't have sources for. ;-)