Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!spool.mu.edu!uunet!unisoft!rembo From: rembo@unisoft.UUCP (Tony Rems) Newsgroups: comp.unix.internals Subject: Re: How to distinguish between STREAMS and non-STREAMSD Message-ID: <3335@unisoft.UUCP> Date: 2 Feb 91 00:52:53 GMT References: <15839.279e0b86@levels.sait.edu.au> <2585@root44.co.uk> Reply-To: rembo@unisoft.UUCP (Tony Rems) Organization: UniSoft Corporation -- UNIX R Us. Lines: 21 In article <2585@root44.co.uk> khh@root.co.uk (Keith Holder) writes: > >>josef@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