Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!zaphod.mps.ohio-state.edu!wuarchive!udel!haven.umd.edu!uvaarpa!murdoch!jade!acl3k From: acl3k@jade.cs.Virginia.EDU (Allan Christian Long) Newsgroups: comp.sys.sgi Subject: Re: ioctl Message-ID: <1991May22.161432.25064@murdoch.acc.Virginia.EDU> Date: 22 May 91 16:14:32 GMT References: <1991May21.224750.535@murdoch.acc.Virginia.EDU> <1991May22.143844.6858@cs.dal.ca> Sender: usenet@murdoch.acc.Virginia.EDU Organization: University of Virginia Computer Science Department Lines: 41 In article <1991May22.143844.6858@cs.dal.ca> silvert%biome@cs.dal.ca writes: >In article <1991May21.224750.535@murdoch.acc.Virginia.EDU> acl3k@agate.cs.Virginia.EDU (Allan Christian Long) writes: >> >> if (ioctl(trackerPtr->fileDescriptor, FIONREAD, &charsToRead) < 0) >> >>The first parameter is a file descriptor and the third is a pointer to >>a long. FIONREAD is a parameter from the termio.h file. I have RTFM'ed >>until I'm blue in the face, but I can't find FIONREAD mentioned anywhere >>in any of the manuals. The SunOS manual has a page on "filio" that >>describes this parameter, but there is no filio page for IRIX. > >On my PI with Irix 3.3.1 the value of FIONREAD is defined in >sys/ioctl.h, not in sys/termio.h -- termio.h defines oFIONREAD, but you >need to look at ioctl.h and figure out the cryptic low-level code there >to get the value of FIONREAD. You're right, it was in ioctl.h, not termio.h. > >As a general rule, I find that grepping my way through /usr/include and >/usr/include/sys is the best way to solve these header problems. The problem is that the prototype for ioctl is int ioctl (int fildes, int request, ...); That says what the first and second parameters should be, but I need to find out about the rest, which are dependent upon what request is. The entry for FIONREAD in ioctl.h is #define FIONREAD _IOR(f, 127, int) /* get # bytes to read */ I tried changing charToRead to an int, but that didn't help. I need documentation for FIONREAD, more than what it says in the header file. >-- >William Silvert, Habitat Ecology Division, Bedford Inst. of Oceanography >P. O. Box 1006, Dartmouth, Nova Scotia, CANADA B2Y 4A2. Tel. (902)426-1577 >UUCP=..!{uunet|watmath}!dalcs!biome!silvert >BITNET=silvert%biome%dalcs@dalac InterNet=silvert%biome@cs.dal.ca A. Chris Long, Jr. acl3k@virginia.edu