How to distinguish between STREAMS and non-STREAMSD

ccdn at levels.sait.edu.au ccdn at levels.sait.edu.au
Thu Jan 24 09:17:42 AEST 1991


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.

This is a guess, and right now I don't have the facilities to test it out.

I assume that getmsg/putmsg will return errno = E_INVALID if you pass it a
STREAMS fd?  So why not assume that getmsg/putmsg will work, and test the
return result; if you get errno = E_INVALID then try your STREAMS code; if
that fails, and if you've got nothing else to try, then you're stuck.  (But
then, in that case you always would have been stuck, wouldn't you?)

David Newall, who no longer works       Phone:  +61 8 344 2008
for SA Institute of Technology          E-mail: ccdn at lux.sait.edu.au
"Life is uncertain:  Eat dessert first"  *Check the return address!*



More information about the Comp.unix.internals mailing list