Path: utzoo!mnetor!uunet!oddjob!ncar!ames!ucsd!sdcc6!sdcc7!muller From: muller@sdcc7.ucsd.EDU (Keith Muller) Newsgroups: comp.unix.wizards Subject: Re: Pty ports and TIOCUCNTL mode Message-ID: <1013@sdcc7.ucsd.EDU> Date: 17 Apr 88 17:21:56 GMT References: <576@modular.UUCP> Distribution: comp Organization: University of California, San Diego Lines: 20 Summary: TIOCUCNTL Use On 4.3 BSD this changes the reads on the master side pty to always be preceeded by a extra byte. If the first byte on a read is a 0, then the rest of the data is the result of a write on the slave side. A nonzero first byte is the user ioctl sent. For example here are two ioctls for this mode. WHen a slave side process does a ioctl(0, JBOOT, 0) the master side on a read will see (JBOOT&0xff) as the first byte. JMPX is a special case and is not passed through, it is used to detect is a psuedo port is in the TIOCUCNTL mode. #define JBOOT _IO(u, 1) #define JMPX _IO(u, 0) Watch out though, sun for example has decided to use this mode for its on purposes and it it does not work this way. Keith Muller University of California muller@ucsd.edu