[net.bugs.4bsd] undocumented tty ioctl's

earle@smeagol.UUCP (Greg Earle) (07/09/86)

In article <86@houligan.UUCP>, dave@murphy.UUCP (Dave Cornutt) writes:
> In article <165@lownlab.UUCP>, kiely@lownlab.UUCP (James P. Kiely) writes:
> >In our kernel we have three tty related ioctl's
> >in sys/tty.c that are not documented in tty(4).
> >They are TIOCSTART, TIOCSTOP, and TIOCOUTQ.
> >Do these work or were they left out of the
> >documentation because they are garbage? 
> 
> Try looking at /usr/include/sys/ioctl.h.  It lists these ioctl's and a
> few other tty ioctl's that aren't documented.  

From article <3481@sun.uucp>:
>From: guy@sun.uucp (Guy Harris)
>Newsgroups: net.bugs.4bsd
>Subject: The manual page TTY(4) is horribly out of date

You will find TIOCSTART, TIOCSTOP, and TIOCOUTQ all documented in this
document that Guy posted.  It also mentions TIOCSTI; alas, not TIOCSETM
nor TIOCREMOTE ...
-- 
	Greg Earle	UUCP: sdcrdcf!smeagol!earle
	JPL		ARPA: elroy!smeagol!earle@csvax.caltech.edu

Yow!  Are you the self-frying president?

guy@sun.UUCP (07/10/86)

> You will find TIOCSTART, TIOCSTOP, and TIOCOUTQ all documented in this
> document that Guy posted.  It also mentions TIOCSTI; alas, not TIOCSETM
> nor TIOCREMOTE ...

All three of the first (along with the others I added documentation for) are
in the 4.3BSD manual page.  TIOCSETM isn't implemented in 4.2BSD or 4.3BSD,
and so isn't and shouldn't be documented.  TIOCREMOTE is not a general tty
driver feature, but a pseudo-tty driver feature, and is documented in the
4.2BSD and 4.3BSD "pty.4" manual page, although the explanation there leaves
something to be desired.
-- 
	Guy Harris
	{ihnp4, decvax, seismo, decwrl, ...}!sun!guy
	guy@sun.com (or guy@sun.arpa)

mouse@mcgill-vision.UUCP (07/12/86)

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

In article <86@houligan.UUCP>, dave@murphy.UUCP (Dave Cornutt) writes:
> Summary: description of TIOCSTOP, TIOCSTART, TIOCOUTQ
> In article <165@lownlab.UUCP>, kiely@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@uw-beaver.arpa

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