Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 20 Aug 1997 00:28:09 -0700 (PDT)
From:      Alex Belits <abelits@phobos.illtel.denver.co.us>
To:        Joerg Wunsch <joerg_wunsch@uriah.heep.sax.de>
Cc:        hackers@FreeBSD.ORG
Subject:   Re: S_ISFIFO and S_ISSOCK
Message-ID:  <Pine.LNX.3.95.970820002314.5757B-100000@phobos.illtel.denver.co.us>
In-Reply-To: <19970820083548.RY05593@uriah.heep.sax.de>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.LNX.3.95.970820002314.5757B-100000>