undocumented tty ioctl's

mouse at mcgill-vision.UUCP mouse at mcgill-vision.UUCP
Sat Jul 12 18:09:33 AEST 1986


(net.bugsers skip to the last >ed portion)

In article <86 at houligan.UUCP>, dave at murphy.UUCP (Dave Cornutt) writes:
> Summary: description of TIOCSTOP, TIOCSTART, TIOCOUTQ
> In article <165 at lownlab.UUCP>, kiely at lownlab.UUCP (James P. Kiely) writes:
>> In our kernel we have three [...] ioctl's [...] not documented
>> They are TIOCSTART, TIOCSTOP, and TIOCOUTQ.
>
> Try looking at /usr/include/sys/ioctl.h.
> TIOCSTOP stops output [...] TIOCSTART [starts output]
> TIOCOUTQ [...] attempts to return the number of characters that are
> backed up on the output queue.  In practice, it tends to lag behind
> the driver a bit.

     I wonder if this isn't because the driver has printed a couple more
characters by  the time control returns to your  code....or  because  it
doesn't count characters which  have been passed to the hardware but not
yet printed....

> P.S.: there are some other[s] [...] like TIOCSTI [...], TIOCSETM
> [...], and TIOCREMOTE ("remote editing" -- wonder what this does?).

     This one is actually documented,  sort  of.   Read pty(4).   Beware
though,  there is  a  nasty  gotcha lurking  here.  The  description  of
TIOCREMOTE does not explicitly describe how  the third ioctl()  argument
is used, but leads you to believe it is similar to TIOCPKT.  This is not
the case in some systems (but it  is  in  others).   On our  system, for
example,  TIOCREMOTE was defined with _IO rather than _IOW, meaning that
the ioctl did not take an argument.  However, the code to implement void
(no-argument) ioctls  treats  the third argument  as a  by-value integer
argument!  This is WRONG, in my opinion, but them's the breaks.  Since I
was  unable to  find  ANY source  code  which  used TIOCREMOTE, I simply
changed  the  definition and  rebuilt  UNIX.  I consoled myself with the
thought  that  Sun  already  did  this  in  their  4.2  port  (Sun  UNIX
2.something); I  discovered the problem when trying  to  lift code I had
working on the Sun for use on our VAX.

     Does anyone  out there know of any code that uses  TIOCREMOTE?  I'd
especially like to  hear if it's something distributed with 4.2, but I'd
be interested  in hearing  about any code,  even application code, which
uses this mode of ptys.
-- 
					der Mouse

USA: {ihnp4,decvax,akgua,utzoo,etc}!utcsri!mcgill-vision!mouse
     philabs!micomvax!musocs!mcgill-vision!mouse
Europe: mcvax!decvax!utcsri!mcgill-vision!mouse
        mcvax!seismo!cmcl2!philabs!micomvax!musocs!mcgill-vision!mouse
ARPAnet: utcsri!mcgill-vision!mouse at uw-beaver.arpa

"Come with me a few minutes, mortal, and we shall talk."



More information about the Comp.unix.wizards mailing list