*BSD News Article 79559


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.carno.net.au!harbinger.cc.monash.edu.au!munnari.OZ.AU!spool.mu.edu!uwm.edu!cs.utexas.edu!howland.erols.net!newsfeed.internetmci.com!news-in2.uu.net!news.artisoft.com!usenet
From: Terry Lambert <terry@lambert.org>
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: Re: Named pipe with mknod
Date: Mon, 30 Sep 1996 11:49:14 -0700
Organization: Me
Lines: 27
Message-ID: <3250162A.5A2B559@lambert.org>
References: <GORSKI.96Sep30150728@axiom.somewhere.de>
NNTP-Posting-Host: hecate.artisoft.com
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Mailer: Mozilla 2.01 (X11; I; Linux 1.1.76 i486)

gorski@cips01.physik.uni-bonn.de wrote:
] Compile the program below and run it. On FreeBSD it produces:
] mknod: Invalid argument
] 
] Why ??
] I thought this should run on FreeBSD without using mkfifo.

]   if ( (mknod("fifo", S_IFIFO|0666, 0))==-1 )
]     perror("mknod");

Because mknod() can't make FIFO's.

For Linux and IBCS2 compatability, the system call, when called
from those binaries, *will* make a FIFO.

This is a generic BSD'ism, and has been around forever (since
back when FIFO's weren't unified with an FS switch).  It should
probably be changed to conform with reality, and the mkfifo()
call should be legacied into libcompat as a call to mknod.  This
is one of the *few* occasions where "BSD flavor" is sour.


                                        Terry Lambert
                                        terry@lambert.org
---
Any opinions in this posting are my own and not those of my present
or previous employers.