Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!mips!sgi!rpw3@rigden.wpd.sgi.com From: rpw3@rigden.wpd.sgi.com (Rob Warnock) Newsgroups: comp.sys.sgi Subject: Re: ioctl Message-ID: <105735@sgi.sgi.com> Date: 23 May 91 03:20:58 GMT References: <1991May21.224750.535@murdoch.acc.Virginia.EDU> <105553@sgi.sgi.com> Sender: guest@sgi.sgi.com Reply-To: rpw3@sgi.com (Rob Warnock) Organization: Silicon Graphics, Inc., Mountain View, CA Lines: 23 In article <105553@sgi.sgi.com> I wrote: +-+------------- | | an ioctl call is giving me an "Invalid argument error". The | | call looks like this: | | if (ioctl(trackerPtr->fileDescriptor, FIONREAD, &charsToRead) < 0) | +--------------- | ... I just checked, and on Irix 3.3.2, FIONREAD is not supported on | pipes or plain files. You get errno=25. +--------------- As a work-around, you might try using select() in polling mode as a (partial) replacement for icotl(,FIONREAD,). A select() "poll" can be done by providing a "timeout" argument (a pointer to a "struct timeval"), but making the "timval" structure pointed to contain all zeros. See the select(2) man page. -Rob ----- Rob Warnock, MS-1L/515 rpw3@sgi.com rpw3@pei.com Silicon Graphics, Inc. (415)335-1673 Protocol Engines, Inc. 2011 N. Shoreline Blvd. Mountain View, CA 94039-7311