ioctl

Allan Christian Long acl3k at jade.cs.Virginia.EDU
Thu May 23 02:14:32 AEST 1991


In article <1991May22.143844.6858 at cs.dal.ca> silvert%biome at cs.dal.ca writes:
>In article <1991May21.224750.535 at murdoch.acc.Virginia.EDU> acl3k at 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 at dalac	InterNet=silvert%biome at cs.dal.ca


A. Chris Long, Jr.			acl3k at virginia.edu



More information about the Comp.sys.sgi mailing list