From: iiitac@swan.pyr (Alan Cox) Subject: Re: [Q] Problem with named pipes and fstat Date: 6 Apr 1993 09:28:14 GMT
In article <734038134snz@chobby.demon.co.uk> hyphen@chobby.demon.co.uk writes:
>
>I am porting some software to Linux. This software uses named pipes to enable
>processes to talk to each other. I am reading characters from the pipes,
>and am first checking for the availability of a character with the fstat
>function call. This should return the size (number of characters) of the
>pipe - if this is non zero then I read a character. The size should be
>returned in st_size from <stat.h>.
>
>The problem.. fstat seems to always return st_size of 0, although it
>has returned with a normal completion code. I know there IS stuff in the
>pipe, because I can read it directly after the fstat call.
>
I guess it could be viewed as a bug. I tried using fstat() for named pipe
work a long time ago and discovered it really depends on what Unix variant
you use whether it works or not. When I tried it, it worked on Sys5.2 and
Sys5.3 but not on Ultrix (suprise).
Alan