From owner-freebsd-hackers Wed Aug 20 00:08:24 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id AAA04529 for hackers-outgoing; Wed, 20 Aug 1997 00:08:24 -0700 (PDT) Received: from phobos.illtel.denver.co.us (abelits@phobos.illtel.denver.co.us [207.33.75.1]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id AAA04513 for ; Wed, 20 Aug 1997 00:08:19 -0700 (PDT) Received: from localhost (abelits@localhost) by phobos.illtel.denver.co.us (8.8.5/8.6.9) with SMTP id AAA06141; Wed, 20 Aug 1997 00:28:09 -0700 Date: Wed, 20 Aug 1997 00:28:09 -0700 (PDT) From: Alex Belits To: Joerg Wunsch cc: hackers@FreeBSD.ORG Subject: Re: S_ISFIFO and S_ISSOCK In-Reply-To: <19970820083548.RY05593@uriah.heep.sax.de> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk On Wed, 20 Aug 1997, J Wunsch wrote: > 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 3.0? > > 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. I know that -- it's just was surprising that I create a socket, and then it's recognized as a pipe (my program creates pipes and sockets, and another program that is connected through them should talk to the first one differently depending on the kind of connection). Does/did anything else 4.4BSD-based behave like that? -- Alex