v07i001: ularn - ultra-larn, an enhancement of the larn adventure game, Part01/08

Guy Harris guy at auspex.auspex.com
Thu Jul 13 03:55:30 AEST 1989


>I could not compile this on my (SYSV) 3b1, because gcc could not find
>TCIFLUSH.  Neither could I.  What am I missing here.
>
>BTW, what's tcflush()?  It's the function being called with the above
>symbol, but I don't know anything else.

Wow.  Does this mean "ularn" is one of the first programs ever written
to the POSIX interface?  Unfortunately, since I don't know how many
systems have implemented that interface yet but think the answer is
"very few, if any", the author may be jumping the gun a bit....

Instead of having "ioctl()", POSIX introduced functions for various
"ioctl" functions; "tcflush()" is the function for the TCFLSH "ioctl". 
They also introduced defined constants instead of the small integers
used by those "ioctl"s; TCIFLUSH is "flush the input queue", i.e. 0.

So

	tcflush(fd, TCIFLUSH)

is equivalent to

	ioctl(fd, TCFLSH, 0)

and returns the same value (0 on success, -1 on error after setting
"errno"). 



More information about the Comp.sources.bugs mailing list