Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utcs!mnetor!seismo!cmcl2!philabs!micomvax!musocs!mcgill-vision!mouse From: mouse@mcgill-vision.UUCP Newsgroups: net.bugs.4bsd,net.unix-wizards Subject: Re: undocumented tty ioctl's Message-ID: <455@mcgill-vision.UUCP> Date: Sat, 12-Jul-86 04:09:33 EDT Article-I.D.: mcgill-v.455 Posted: Sat Jul 12 04:09:33 1986 Date-Received: Sun, 13-Jul-86 07:01:27 EDT References: <86@houligan.UUCP> Organization: McGill University, Montreal Lines: 51 Xref: utcs net.bugs.4bsd:2138 net.unix-wizards:18148 (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."