How to distinguish between STREAMS and non-STREAMSD

Tony Rems rembo at unisoft.UUCP
Sat Feb 2 11:52:53 AEST 1991


In article <2585 at root44.co.uk> khh at root.co.uk (Keith Holder) writes:
>
>>josef at nixpbe.nixdorf.de (josef Moellers) writes:
>>>Does anybody now of a bulletproof and FAST method to distinguish between
>>>a STREAMS fd and a non-STREAMS fd?
>>>I cannot use calls to getmsg/putmsg, as I am not allowed to change the
>>>state of the STREAM.
>
>In System V Release 4, there is a library function called isastream(3C), which 
>takes a file descriptor as an argument. It returns 1 if fildes represents a
>STREAMS file, 0 if not. It behaves very much like  isatty().
>	I don't know whether this function was available in previous releases.

The isastream(3C) library routine just does and ioctl(2) with the I_CANPUT
request.  So, if the pre-SVR4 system you have doesn't have the I_CANPUT
(and I don't see it in the SVR3.2 STREAMS programmer's guide), you
probably don't have this and can't simulate it in the same simple way :).

Just my two bits.

-Tony



More information about the Comp.unix.internals mailing list