Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!zaphod.mps.ohio-state.edu!think.com!linus!nixbur!nixpbe!ugun13!ugum01!josef From: josef@nixpbe.nixdorf.de (josef Moellers) Newsgroups: comp.unix.internals Subject: Re: How to distinguish between STREAMS and non-STREAMS Keywords: STREAMS tty character-special Message-ID: Date: 17 Jan 91 08:13:37 GMT References: Sender: news@ugun13.UUCP Lines: 27 In dcm@baldur.dell.com (Dave McCracken) 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. >I would say right offhand you should do a streams-specific query ioctl. >A few that might be useful are I_LOOK, I_GRDOPT, I_GRWOPT, and I_LIST. >I_LIST might be particularly fast since if you pass it a NULL pointer >for the list, it just returns the number of modules on the stream, >and this information comes directly out of the stream head. This was my first approach. We have access to the source code, so I used I_GRDOPT, as this referenced a single field in the stream head, and so was fastest. But ... the f!@#$%^&*( SCO UNIX uses the numerical code for I_GRDOPT on ttys to switch modes on the console windows, so when the application calls the select()-function -whoops- goes Your screen! -- | Josef Moellers | c/o Siemens Nixdorf Informationssysteme AG | | USA: mollers.pad@nixdorf.com | Abt. STO-XS 113 | | !USA: mollers.pad@nixdorf.de | Heinz-Nixdorf-Ring | | Phone: (+49) 5251 104662 | D-4790 Paderborn |