*BSD News Article 25079


Return to BSD News archive

Xref: sserve comp.os.lynx:133 comp.unix.bsd:13101
Newsgroups: comp.os.lynx,comp.unix.bsd
Path: sserve!newshost.anu.edu.au!munnari.oz.au!news.Hawaii.Edu!ames!sgiblab!sgigate.sgi.com!sgi!zok!wattres!steve
From: steve@wattres.SJ.CA.US (Steve Watt -- KD6GGD)
Subject: Re: select, read and named pipes
References: <2eit5g$t3i@news.parc.xerox.com>
Organization: Steven Watt, Consultant   San Jose, CA, USA
Message-ID: <1993Dec14.192758.26204@wattres.SJ.CA.US>
Date: Tue, 14 Dec 93 19:27:58 GMT
Lines: 33

In article <2eit5g$t3i@news.parc.xerox.com> leisner@sdsp.mc.xerox.com writes:
>I have this program:
>/tmp/devpp is a named pipe.
>
>	1) on sunos sparc it run as expected (processes can 
>	open/close /tmp/devpp, and select is only knocked out when
>	something is there to be read.

I hope it gets a read that returns 0, as well.  That's the only way to detect
end-of-file, after all.

>	2) on lynx/sparc, it works until the first process terminates
>	(closes the pipe).   Then select returns a postive response
>	(something interesting happened), and read returns 0 (nothing
>	to read).

Which is as one would expect, unless it does it continuously.

[ sample program elided ]

>I would appreciate if this was run on other BSD systems to determine 
>the behavior.   Also any comments on whether the SunOS behavior is
>correct or not... 

Well, on my BSDI box, select returns a positive response, and read returns 0.
That's also the way my Ultrix (4.1) system works.

Just a few data points.
-- 
Steve Watt KD6GGD                       Packet: KD6GGD @ N0ARY.#NOCAL.CA.USA.NA
ICBM: 121W 56' 53.1" / 37N 20' 16.7"     Internet: Home: steve@wattres.SJ.CA.US
"I am always ready to learn, although I                    Work: swatt@lynx.com
don't always like being taught." -- Winston Churchill