From: David van Moolenbroek Date: Sat, 17 Mar 2012 13:14:59 +0000 (+0100) Subject: Remove unsupported legacy TIOC[GS]ET[PC] ioctls X-Git-Tag: v3.2.1~656 X-Git-Url: http://zhaoyanbai.com/repos/%24relpath%24tabs.css?a=commitdiff_plain;h=91a1d11c1195ff7ef46f09ecec82d1093d71664a;p=minix.git Remove unsupported legacy TIOC[GS]ET[PC] ioctls --- diff --git a/commands/mdb/ioctl.c b/commands/mdb/ioctl.c index 4cc1d8838..3da505ff7 100644 --- a/commands/mdb/ioctl.c +++ b/commands/mdb/ioctl.c @@ -17,18 +17,6 @@ PRIVATE int get_request; -PRIVATE char *rnames[] = { - "TIOCGETP", - "TIOCSETP", - "TIOCGETC", - "TIOCSETC" -}; - -#define GETPNAME 0 -#define SETPNAME 1 -#define GETCNAME 2 -#define SETCNAME 3 - /* * decode ioctl call * send or receive = 'R' or 'S' @@ -37,12 +25,9 @@ void decode_ioctl(sr, m) int sr; message *m; { -int rq; int request, device; int high; long spek, flags; -int ispeed, ospeed, speed, erase, kill; -int t_intrc, t_quitc, t_startc, t_stopc, t_brk, t_eof; device = m->m2_i1; request = m->m2_i3; @@ -60,86 +45,22 @@ int t_intrc, t_quitc, t_startc, t_stopc, t_brk, t_eof; if ( sr == 'R') request = get_request; - switch(request) { - case TIOCGETP: - case TIOCSETP: - rq = (request == TIOCGETP) ? GETPNAME : SETPNAME; - if (sr == 'S') { - get_request = request; - Printf( "Sending %s ",rnames[rq] ); - if ( request == TIOCGETP ) break; - } - - if ( (sr == 'R') && (request == TIOCSETP) ) break; - - erase = (spek >> 8) & BYTE; - kill = spek & BYTE; - flags = flags & 0xFFFF; - speed = (spek >> 16) & 0xFFFFL; - ispeed = speed & BYTE; - ospeed = (speed >> 8) & BYTE; - Printf("%s erase=%d kill=%d speed=%d/%d flags=%lx ", - rnames[rq], erase, kill, ispeed, ospeed, flags); - break; - - case TIOCGETC: - case TIOCSETC: - rq = (request == TIOCGETC) ? GETCNAME : SETCNAME; - if (sr == 'S') { - get_request = request; - Printf( "Sending %s ",rnames[rq] ); - if ( request == TIOCGETC ) break; - } - - if ( (sr == 'R') && (request == TIOCSETC) ) break; - - t_intrc = (spek >> 24) & BYTE; - t_quitc = (spek >> 16) & BYTE; - t_startc = (spek >> 8) & BYTE; - t_stopc = (spek >> 0) & BYTE; - t_brk = flags & BYTE; - t_eof = (flags >> 8 ) & BYTE; - Printf("%s int %d quit %d start %d stop %d brk %d eof %d\n", - rnames[rq], - t_intrc, t_quitc, t_startc, t_stopc, t_brk, t_eof); - break; - - default: - -#ifdef __i86 /* 16 bit */ - if ( sr == 'S' ) { - Printf("Sending "); - get_request = request; - } - else - Printf("Receiving "); - - Printf("Other IOCTL device=%d request=%c|%d\n", - device, (request >> 8) & BYTE, request & BYTE ); - - break; -#endif - -#ifdef __i386 /* 32 bit encoding */ - if ( sr == 'S' ) { - Printf("Sending (%lx) ", request); - get_request = request; - } - else - Printf("Receiving (%lx) ", request); + if ( sr == 'S' ) { + Printf("Sending (%lx) ", request); + get_request = request; + } + else + Printf("Receiving (%lx) ", request); - high = ( request & 0xFFFF0000 ) >> 16 ; - request &= _IOCTYPE_MASK; - - Printf("Other IOCTL device=%d request=%c|%d flags=%x size =%d\n", - device, (request >> 8) & BYTE, request & BYTE, - (high & ~_IOCPARM_MASK ), - (high & _IOCPARM_MASK ) - ); - break; -#endif - } - Printf("\n"); + high = ( request & 0xFFFF0000 ) >> 16 ; + request &= _IOCTYPE_MASK; + + Printf("Other IOCTL device=%d request=%c|%d flags=%x size =%d\n", + device, (request >> 8) & BYTE, request & BYTE, + (high & ~_IOCPARM_MASK ), + (high & _IOCPARM_MASK ) + ); + Printf("\n"); } diff --git a/common/include/sys/ioc_tty.h b/common/include/sys/ioc_tty.h index c37972443..ff42c13a5 100644 --- a/common/include/sys/ioc_tty.h +++ b/common/include/sys/ioc_tty.h @@ -25,12 +25,6 @@ #define TIOCSFON_OLD _IOW('T', 20, u8_t [8192]) #define TIOCSFON _IOW_BIG(1, u8_t [8192]) -/* Legacy */ -#define TIOCGETP _IOR('t', 1, struct sgttyb) -#define TIOCSETP _IOW('t', 2, struct sgttyb) -#define TIOCGETC _IOR('t', 3, struct tchars) -#define TIOCSETC _IOW('t', 4, struct tchars) - /* Keyboard ioctls. */ #define KIOCBELL _IOW('k', 1, struct kio_bell) #define KIOCSLEDS _IOW('k', 2, struct kio_leds) diff --git a/man/man4/tty.4 b/man/man4/tty.4 index 6eb77001f..1306ed63b 100644 --- a/man/man4/tty.4 +++ b/man/man4/tty.4 @@ -712,18 +712,6 @@ set to tty input queue to be sent to the pty reader as backspace overstrikes. Some of this output may get lost if the pty reader cannot accept it all at once in a single read call.) -.SS "Backwards compatibility" -The -.BR TIOCGETP , -.BR TIOCSETP , -.BR TIOCGETC -and -.BR TIOCSETC -ioctl functions that are used by the old -.B sgtty -terminal interface are still supported by the terminal driver by emulation. -Note that these old functions cannot control all termios attributes, so the -terminal must be in a relatively sane state to avoid problems. .SH FILES The list below shows all devices that MINIX 3 and Minix-vmd have. Not all of these devices are configured in by default, as indicated by the numbers