From: Tony Stiles (hyphen@chobby.demon.co.uk)
Date: 04/05/93


From: hyphen@chobby.demon.co.uk (Tony Stiles)
Subject: [Q] Problem with named pipes and fstat
Date: 5 Apr 1993 19:28:54 GMT

Hi, I wonder if someone can help me with a small problem I am experiencing
with named pipes and fstat? Any help via Email would be much appreciated.

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.

It's not a buffering problem as I am using the low level file routines.

Is there a known bug in fstat? Is there some other way I can
determine whether there is data available in a pipe?

Not related, but what is max size of a pipe under Linux?

Thanks in advance,
                        Tony
 ____________________________________________________________________________
[Tony Stiles, Southampton, Hampshire, England | "Hey Frank, what happens if ]
[ Internet Email: hyphen@chobby.demon.co.uk | I press THIS little button?"]
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

 ____________________________________________________________________________
[Tony Stiles, Southampton, Hampshire, England | "Hey Frank, what happens if ]
[ Internet Email: hyphen@chobby.demon.co.uk | I press THIS little button?"]
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~