: New termios take 2
Subsystems (4)
RFC PATCH 1/1 : New termios take 2
This is the second revision of the improved termios facilities.
The following extra features are now handled
- Architectures which already have i/ospeed fields and need no new ioctl
- Independent input and output baud rate
- Weirdo speed table for the sparc (Dave *has* to be different)
- Passes a basic test suite
- stty/gtty emulation now correctly handles speeds [it was a one liner ok]
To make this work on your architecture you must have the following bit fields defined
CIBAUD Mask of input speed bits
IBSHIFT Such that (CBAUD << IBSHIFT) is CIBAUD
with the same bit meanings for both fields
BOTHER An unused speed field setting
struct termios_v1 - the existing "old" termios structure struct termios - the new exciting termios structure with c_ispeed/c_ospeed. Should start matching the old structure.
user_termios_to_kernel_termios_v1 kernel_termios_to_user_termios_v1
Copiers for the old termios structure
I intend to submit this to Andrew fairly soon so if you are an architecture maintainer please provide me the defines for your platform or I'll make some up and that might not be the best choice 8)
drivers/char/epca.c +4 -0
@@ -1240,6 +1240,8 @@ pc_driver->init_termios.c_oflag =0 ; pc_driver->init_termios.c_cflag =B9600 |CS8 |CREAD |CLOCAL |HUPCL ; pc_driver->init_termios.c_lflag =0 ; + pc_driver->init_termios.c_ispeed =9600 ; + pc_driver->init_termios.c_ospeed =9600 ; pc_driver->flags =TTY_DRIVER_REAL_RAW ;tty_set_operations (pc_driver, &pc_ops);
@@ -1254,6 +1256,8 @@ pc_info->init_termios.c_oflag =0 ; pc_info->init_termios.c_lflag =0 ; pc_info->init_termios.c_cflag =B9600 |CS8 |CREAD |HUPCL ; + pc_info->init_termios.c_ispeed =9600 ; + pc_info->init_termios.c_ospeed =9600 ; pc_info->flags =TTY_DRIVER_REAL_RAW ;tty_set_operations (pc_info, &info_ops);
drivers/char/generic_serial.c +1 -10
@@ -746,11 +746,9 @@gs_dprintk (GS_DEBUG_TERMIOS ,"termios structure (%p):\n" , tiosp); } -#if 0 /* This is an optimization that is only allowed for dumb cards */ /* Smart cards require knowledge of iflags and oflags too: that might change hardware cooking mode.... */ -#endif if (old_termios) {if ( (tiosp->c_iflag == old_termios->c_iflag) && (tiosp->c_oflag == old_termios->c_oflag)
@@ -774,14 +772,7 @@if (!memcmp (tiosp->c_cc, old_termios->c_cc,NCC ))printk ("c_cc changed\n" ); } - baudrate = tiosp->c_cflag &CBAUD ; -if (baudrate &CBAUDEX ) { - baudrate &= ~CBAUDEX ; -if ((baudrate <1 ) || (baudrate >4 )) - tiosp->c_cflag &= ~CBAUDEX ; -else - baudrate +=15 ; - } + baudrate =tty_get_baud_rate (tty); baudrate = gs_baudrates[baudrate];if ((tiosp->c_cflag &CBAUD ) ==B38400 ) {
drivers/char/hvcs.c +3 -1
@@ -196,7 +196,9 @@ .c_iflag = IGNBRK | IGNPAR, .c_oflag = OPOST, .c_cflag = B38400 | CS8 | CREAD | HUPCL, - .c_cc = INIT_C_CC + .c_cc = INIT_C_CC, + .c_ispeed = 38400, + .c_ospeed = 38400 };/*
drivers/char/hvsi.c +2 -0
@@ -1159,6 +1159,8 @@ hvsi_driver->type =TTY_DRIVER_TYPE_SYSTEM ; hvsi_driver->init_termios = tty_std_termios; hvsi_driver->init_termios.c_cflag =B9600 |CS8 |CREAD |HUPCL ; + hvsi_driver->init_termios.c_ispeed =9600 ; + hvsi_driver->init_termios.c_ospeed =9600 ; hvsi_driver->flags =TTY_DRIVER_REAL_RAW ;tty_set_operations (hvsi_driver, &hvsi_ops);
drivers/char/istallion.c +3 -19
@@ -197,6 +197,8 @@static struct termios stli_deftermios = { .c_cflag = (B9600 |CS8 |CREAD |HUPCL |CLOCAL ), .c_cc =INIT_C_CC , + .c_ispeed =9600 , + .c_ospeed =9600 , };/*
@@ -612,16 +614,6 @@#define MINOR2BRD (min) (((min) & 0xc0) >> 6)#define MINOR2PORT (min) ((min) & 0x3f) -/* -* Define a baud rate table that converts termios baud rate selector -* into the actual baud rate value. All baud rate calculations are based -* on the actual baud rate required. -*/ -static unsigned int stli_baudrates[] = { -0 ,50 ,75 ,110 ,134 ,150 ,200 ,300 ,600 ,1200 ,1800 ,2400 ,4800 , -9600 ,19200 ,38400 ,57600 ,115200 ,230400 ,460800 ,921600 -}; -/*****************************************************************************/ /*
@@ -2747,15 +2739,7 @@/* * Start of by setting the baud, char size, parity and stop bit info. */ - pp->baudout = tiosp->c_cflag &CBAUD ; -if (pp->baudout &CBAUDEX ) { - pp->baudout &= ~CBAUDEX ; -if ((pp->baudout <1 ) || (pp->baudout >4 )) - tiosp->c_cflag &= ~CBAUDEX ; -else - pp->baudout +=15 ; - } - pp->baudout = stli_baudrates[pp->baudout]; + pp->baudout =tty_get_baud_rate (portp->tty);if ((tiosp->c_cflag &CBAUD ) ==B38400 ) {if ((portp->flags &ASYNC_SPD_MASK ) ==ASYNC_SPD_HI ) pp->baudout =57600 ;
drivers/char/moxa.c +9 -75
127 lines not on this page · raw message
drivers/char/mxser.c +3 -65
80 lines not on this page · raw message
drivers/char/pty.c +8 -0
@@ -272,6 +272,8 @@ pty_driver->init_termios.c_oflag =0 ; pty_driver->init_termios.c_cflag =B38400 |CS8 |CREAD ; pty_driver->init_termios.c_lflag =0 ; + pty_driver->init_termios.c_ispeed =38400 ; + pty_driver->init_termios.c_ospeed =38400 ; pty_driver->flags =TTY_DRIVER_RESET_TERMIOS |TTY_DRIVER_REAL_RAW ; pty_driver->other = pty_slave_driver;tty_set_operations (pty_driver, &pty_ops);
@@ -286,6 +288,8 @@ pty_slave_driver->subtype =PTY_TYPE_SLAVE ; pty_slave_driver->init_termios = tty_std_termios; pty_slave_driver->init_termios.c_cflag =B38400 |CS8 |CREAD ; + pty_slave_driver->init_termios.c_ispeed =38400 ; + pty_slave_driver->init_termios.c_ospeed =38400 ; pty_slave_driver->flags =TTY_DRIVER_RESET_TERMIOS |TTY_DRIVER_REAL_RAW ; pty_slave_driver->other = pty_driver;
@@ -366,6 +370,8 @@ ptm_driver->init_termios.c_oflag =0 ; ptm_driver->init_termios.c_cflag =B38400 |CS8 |CREAD ; ptm_driver->init_termios.c_lflag =0 ; + ptm_driver->init_termios.c_ispeed =38400 ; + ptm_driver->init_termios.c_ospeed =38400 ; ptm_driver->flags =TTY_DRIVER_RESET_TERMIOS |TTY_DRIVER_REAL_RAW |TTY_DRIVER_DYNAMIC_DEV |TTY_DRIVER_DEVPTS_MEM ; ptm_driver->other = pts_driver;
@@ -381,6 +387,8 @@ pts_driver->subtype =PTY_TYPE_SLAVE ; pts_driver->init_termios = tty_std_termios; pts_driver->init_termios.c_cflag =B38400 |CS8 |CREAD ; + pts_driver->init_termios.c_ispeed =38400 ; + pts_driver->init_termios.c_ospeed =38400 ; pts_driver->flags =TTY_DRIVER_RESET_TERMIOS |TTY_DRIVER_REAL_RAW |TTY_DRIVER_DYNAMIC_DEV |TTY_DRIVER_DEVPTS_MEM ; pts_driver->other = ptm_driver;
drivers/char/riscom8.c +6 -18
@@ -675,26 +675,12 @@ port->COR2 =0 ; port->MSVR =MSVR_RTS ; - baud =C_BAUD (tty); - -if (baud &CBAUDEX ) { - baud &= ~CBAUDEX ; -if (baud <1 || baud >2 ) - port->tty->termios->c_cflag &= ~CBAUDEX ; -else - baud +=15 ; - } -if (baud ==15 ) { -if ((port->flags &ASYNC_SPD_MASK ) ==ASYNC_SPD_HI ) - baud ++; -if ((port->flags &ASYNC_SPD_MASK ) ==ASYNC_SPD_VHI ) - baud +=2 ; - } + baud =tty_get_baud_rate (tty);/* Select port on the board */ rc_out (bp,CD180_CAR ,port_No (port)); -if (!baud_table[baud]) { +if (!baud) {/* Drop DTR & exit */ bp->DTR |= (1u <<port_No (port));rc_out (bp,RC_DTR , bp->DTR);
@@ -710,7 +696,7 @@*/ /* Set baud rate for port */ - tmp = (((RC_OSCFREQ + baud_table[baud]/2 ) / baud_table[baud] + + tmp = (((RC_OSCFREQ + baud/2 ) / baud +CD180_TPC /2 ) /CD180_TPC );rc_out (bp,CD180_RBPRH , (tmp >>8 ) &0xff );
@@ -718,7 +704,7 @@rc_out (bp,CD180_RBPRL , tmp &0xff );rc_out (bp,CD180_TBPRL , tmp &0xff ); - baud = (baud_table[baud] +5 ) /10 ;/* Estimated CPS */ + baud = (baud +5 ) /10 ;/* Estimated CPS */ /* Two timer ticks seems enough to wakeup something like SLIP driver */ tmp = ((baud +HZ /2 ) /HZ ) *2 -CD180_NFIFO ;
@@ -1640,6 +1626,8 @@ riscom_driver->init_termios = tty_std_termios; riscom_driver->init_termios.c_cflag =B9600 |CS8 |CREAD |HUPCL |CLOCAL ; + riscom_driver->init_termios.c_ispeed =9600 ; + riscom_driver->init_termios.c_ospeed =9600 ; riscom_driver->flags =TTY_DRIVER_REAL_RAW ;tty_set_operations (riscom_driver, &riscom_ops);if ((error =tty_register_driver (riscom_driver))) {
drivers/char/rocket.c +2 -0
@@ -2436,6 +2436,8 @@ rocket_driver->init_termios = tty_std_termios; rocket_driver->init_termios.c_cflag =B9600 |CS8 |CREAD |HUPCL |CLOCAL ; + rocket_driver->init_termios.c_ispeed =9600 ; + rocket_driver->init_termios.c_ospeed =9600 ;#ifdef ROCKET_SOFT_FLOW rocket_driver->flags |=TTY_DRIVER_REAL_RAW |TTY_DRIVER_DYNAMIC_DEV ;#endif
drivers/char/ser_a2232.c +2 -0
@@ -695,6 +695,8 @@ a2232_driver->init_termios = tty_std_termios; a2232_driver->init_termios.c_cflag =B9600 |CS8 |CREAD |HUPCL |CLOCAL ; + a2232_driver->init_termios.c_ispeed =9600 ; + a2232_driver->init_termios.c_ospeed =9600 ; a2232_driver->flags =TTY_DRIVER_REAL_RAW ;tty_set_operations (a2232_driver, &a2232_ops);if ((error =tty_register_driver (a2232_driver))) {
drivers/char/specialix.c +6 -12
@@ -1087,24 +1087,16 @@ port->MSVR = (sx_in (bp, CD186x_MSVR) &MSVR_RTS );spin_unlock_irqrestore (&bp->lock, flags);dprintk (SX_DEBUG_TERMIOS ,"sx: got MSVR=%02x.\n" , port->MSVR); - baud =C_BAUD (tty); + baud =tty_get_baud_rate (tty); -if (baud &CBAUDEX ) { - baud &= ~CBAUDEX ; -if (baud <1 || baud >2 ) - port->tty->termios->c_cflag &= ~CBAUDEX ; -else - baud +=15 ; - } -if (baud ==15 ) { +if (baud ==38400 ) {if ((port->flags &ASYNC_SPD_MASK ) ==ASYNC_SPD_HI ) baud ++;if ((port->flags &ASYNC_SPD_MASK ) ==ASYNC_SPD_VHI ) baud +=2 ; } - -if (!baud_table[baud]) { +if (!baud) {/* Drop DTR & exit */ dprintk (SX_DEBUG_TERMIOS ,"Dropping DTR... Hmm....\n" );if (!SX_CRTSCTS (tty)) {
@@ -1134,7 +1126,7 @@"This is an untested option, please be carefull.\n" , port_No (port), tmp); else - tmp = (((SX_OSCFREQ + baud_table[baud]/2 ) / baud_table[baud] + + tmp = (((SX_OSCFREQ + baud/2 ) / baud + CD186x_TPC/2 ) / CD186x_TPC);if ((tmp <0x10 ) &&time_before (again, jiffies)) {
@@ -2420,6 +2412,8 @@ specialix_driver->init_termios = tty_std_termios; specialix_driver->init_termios.c_cflag =B9600 |CS8 |CREAD |HUPCL |CLOCAL ; + specialix_driver->init_termios.c_ispeed =9600 ; + specialix_driver->init_termios.c_ospeed =9600 ; specialix_driver->flags =TTY_DRIVER_REAL_RAW ;tty_set_operations (specialix_driver, &sx_ops);
drivers/char/stallion.c +2 -0
@@ -146,6 +146,8 @@static struct termios stl_deftermios = { .c_cflag = (B9600 |CS8 |CREAD |HUPCL |CLOCAL ), .c_cc =INIT_C_CC , + .c_ispeed =9600 , + .c_ospeed =9600 , };/*
drivers/char/sx.c +2 -0
@@ -2263,6 +2263,8 @@ sx_driver->init_termios = tty_std_termios; sx_driver->init_termios.c_cflag =B9600 |CS8 |CREAD |HUPCL |CLOCAL ; + sx_driver->init_termios.c_ispeed =9600 ; + sx_driver->init_termios.c_ospeed =9600 ; sx_driver->flags =TTY_DRIVER_REAL_RAW ;tty_set_operations (sx_driver, &sx_ops);
drivers/char/synclink.c +2 -0
@@ -4404,6 +4404,8 @@ serial_driver->init_termios = tty_std_termios; serial_driver->init_termios.c_cflag =B9600 |CS8 |CREAD |HUPCL |CLOCAL ; + serial_driver->init_termios.c_ispeed =9600 ; + serial_driver->init_termios.c_ospeed =9600 ; serial_driver->flags =TTY_DRIVER_REAL_RAW ;tty_set_operations (serial_driver, &mgsl_ops);if ((rc =tty_register_driver (serial_driver)) <0 ) {
drivers/char/synclink_gt.c +2 -0
@@ -3537,6 +3537,8 @@ serial_driver->init_termios = tty_std_termios; serial_driver->init_termios.c_cflag =B9600 |CS8 |CREAD |HUPCL |CLOCAL ; + serial_driver->init_termios.c_ispeed =9600 ; + serial_driver->init_termios.c_ospeed =9600 ; serial_driver->flags =TTY_DRIVER_REAL_RAW ;tty_set_operations (serial_driver, &ops);if ((rc =tty_register_driver (serial_driver)) <0 ) {
drivers/char/synclinkmp.c +2 -0
@@ -4033,6 +4033,8 @@ serial_driver->init_termios = tty_std_termios; serial_driver->init_termios.c_cflag =B9600 |CS8 |CREAD |HUPCL |CLOCAL ; + serial_driver->init_termios.c_ispeed =9600 ; + serial_driver->init_termios.c_ospeed =9600 ; serial_driver->flags =TTY_DRIVER_REAL_RAW ;tty_set_operations (serial_driver, &ops);if ((rc =tty_register_driver (serial_driver)) <0 ) {
drivers/char/tty_io.c +35 -90
177 lines not on this page · raw message
drivers/char/tty_ioctl.c +239 -12
336 lines not on this page · raw message
drivers/char/vme_scc.c +2 -0
@@ -153,6 +153,8 @@ scc_driver->init_termios = tty_std_termios; scc_driver->init_termios.c_cflag =B9600 |CS8 |CREAD |HUPCL |CLOCAL ; + scc_driver->init_termios.c_ispeed =9600 ; + scc_driver->init_termios.c_ospeed =9600 ; scc_driver->flags =TTY_DRIVER_REAL_RAW ;tty_set_operations (scc_driver, &scc_ops);
drivers/serial/crisv10.c +2 -0
@@ -4877,6 +4877,8 @@ driver->init_termios = tty_std_termios; driver->init_termios.c_cflag =B115200 |CS8 |CREAD |HUPCL |CLOCAL ;/* is normally B9600 default... */ + driver->init_termios.c_ispeed =115200 ; + driver->init_termios.c_ospeed =115200 ; driver->flags =TTY_DRIVER_REAL_RAW |TTY_DRIVER_DYNAMIC_DEV ; driver->termios = serial_termios; driver->termios_locked = serial_termios_locked;
drivers/serial/serial_core.c +1 -0
@@ -2184,6 +2184,7 @@ normal->subtype =SERIAL_TYPE_NORMAL ; normal->init_termios = tty_std_termios; normal->init_termios.c_cflag =B9600 |CS8 |CREAD |HUPCL |CLOCAL ; + normal->init_termios.c_ispeed = normal->init_termios.c_ospeed =9600 ; normal->flags =TTY_DRIVER_REAL_RAW |TTY_DRIVER_DYNAMIC_DEV ; normal->driver_state = drv;tty_set_operations (normal, &uart_ops);
include/asm-alpha/termbits.h +6 -0
@@ -21,10 +21,15 @@tcflag_t c_lflag;/* local mode flags */ cc_t c_cc[NCCS ];/* control characters */ cc_t c_line;/* line discipline (== c_cc[19]) */ +/* These two are not used in the old termios support but are in the +new termios and will be valid if speed is BOTHER (itself not valid +in old termios */ speed_t c_ispeed;/* input speed */ speed_t c_ospeed;/* output speed */ }; +#define _HAVE_NO_TERMIOS_COMPAT +/* c_cc characters */ #define VEOF 0#define VEOL 1
@@ -134,6 +139,7 @@#define B3000000 00034#define B3500000 00035#define B4000000 00036 +#define BOTHER 00037/* Other baud rate via _ispeed/_ospeed */ #define CSIZE 00001400#define CS5 00000000
include/asm-cris/ioctls.h +5 -0
@@ -48,6 +48,11 @@#define TIOCSBRK 0x5427/* BSD compatibility */ #define TIOCCBRK 0x5428/* BSD compatibility */ #define TIOCGSID 0x5429/* Return the session ID of FD */ +#define TCGETS2 _IOR('T',0x2A, struct termios) +#define TCSETS2 _IOW('T',0x2B, struct termios) +#define TCSETSW2 _IOW('T',0x2C, struct termios) +#define TCSETSF2 _IOW('T',0x2D, struct termios) +#define TIOCGPTN _IOR('T',0x30, unsigned int)/* Get Pty Number (of pty-mux device) */ #define TIOCSPTLCK _IOW('T',0x31, int)/* Lock/unlock Pty */
include/asm-cris/termbits.h +12 -0
@@ -10,6 +10,15 @@typedef unsigned int tcflag_t ;#define NCCS 19 +struct termios_v1 { +tcflag_t c_iflag;/* input mode flags */ +tcflag_t c_oflag;/* output mode flags */ +tcflag_t c_cflag;/* control mode flags */ +tcflag_t c_lflag;/* local mode flags */ +cc_t c_line;/* line discipline */ +cc_t c_cc[NCCS ];/* control characters */ +}; +struct termios {tcflag_t c_iflag;/* input mode flags */ tcflag_t c_oflag;/* output mode flags */
@@ -17,6 +26,8 @@tcflag_t c_lflag;/* local mode flags */ cc_t c_line;/* line discipline */ cc_t c_cc[NCCS ];/* control characters */ +speed_t c_ispeed;/* input speed */ +speed_t c_ospeed;/* output speed */ };/* c_cc characters */
@@ -144,6 +155,7 @@#define HUPCL 0002000#define CLOCAL 0004000#define CBAUDEX 0010000 +#define BOTHER 0010000/* non standard rate */ #define B57600 0010001#define B115200 0010002#define B230400 0010003
include/asm-cris/termios.h +2 -0
@@ -99,6 +99,8 @@copy_to_user ((termio)->c_cc, (termios)->c_cc,NCC ); \ }) +#define user_termios_to_kernel_termios_1 (k, u) copy_from_user(k, u, sizeof(struct termios_1)) +#define kernel_termios_to_user_termios_1 (u, k) copy_to_user(u, k, sizeof(struct termios_1))#define user_termios_to_kernel_termios (k, u) copy_from_user(k, u, sizeof(struct termios))#define kernel_termios_to_user_termios (u, k) copy_to_user(u, k, sizeof(struct termios))
include/asm-i386/ioctls.h +6 -0
@@ -47,6 +47,12 @@#define TIOCSBRK 0x5427/* BSD compatibility */ #define TIOCCBRK 0x5428/* BSD compatibility */ #define TIOCGSID 0x5429/* Return the session ID of FD */ + +#define TCGETS2 _IOR('T',0x2A, struct termios) +#define TCSETS2 _IOW('T',0x2B, struct termios) +#define TCSETSW2 _IOW('T',0x2C, struct termios) +#define TCSETSF2 _IOW('T',0x2D, struct termios) +#define TIOCGPTN _IOR('T',0x30, unsigned int)/* Get Pty Number (of pty-mux device) */ #define TIOCSPTLCK _IOW('T',0x31, int)/* Lock/unlock Pty */
include/asm-i386/termbits.h +16 -1
@@ -8,6 +8,16 @@typedef unsigned int tcflag_t ;#define NCCS 19 + +struct termios_v1 {/* Deprecated termios */ +tcflag_t c_iflag;/* input mode flags */ +tcflag_t c_oflag;/* output mode flags */ +tcflag_t c_cflag;/* control mode flags */ +tcflag_t c_lflag;/* local mode flags */ +cc_t c_line;/* line discipline */ +cc_t c_cc[NCCS ];/* control characters */ +}; +struct termios {tcflag_t c_iflag;/* input mode flags */ tcflag_t c_oflag;/* output mode flags */
@@ -15,6 +25,8 @@tcflag_t c_lflag;/* local mode flags */ cc_t c_line;/* line discipline */ cc_t c_cc[NCCS ];/* control characters */ +speed_t c_ispeed;/* input speed */ +speed_t c_ospeed;/* output speed */ };/* c_cc characters */
@@ -118,6 +130,7 @@#define HUPCL 0002000#define CLOCAL 0004000#define CBAUDEX 0010000 +#define BOTHER 0010000/* non standard rate */ #define B57600 0010001#define B115200 0010002#define B230400 0010003
@@ -133,10 +146,12 @@#define B3000000 0010015#define B3500000 0010016#define B4000000 0010017 -#define CIBAUD 002003600000/* input baud rate (not used) */ +#define CIBAUD 002003600000/* input baud rate */ #define CMSPAR 010000000000/* mark or space (stick) parity */ #define CRTSCTS 020000000000/* flow control */ +#define IBSHIFT 8/* Shift from CBAUD to CIBAUD */ +/* c_lflag bits */ #define ISIG 0000001#define ICANON 0000002
include/asm-i386/termios.h +2 -0
@@ -99,6 +99,8 @@copy_to_user ((termio)->c_cc, (termios)->c_cc,NCC ); \ }) +#define user_termios_to_kernel_termios_1 (k, u) copy_from_user(k, u, sizeof(struct termios_1)) +#define kernel_termios_to_user_termios_1 (u, k) copy_to_user(u, k, sizeof(struct termios_1))#define user_termios_to_kernel_termios (k, u) copy_from_user(k, u, sizeof(struct termios))#define kernel_termios_to_user_termios (u, k) copy_to_user(u, k, sizeof(struct termios))
include/asm-ia64/ioctls.h +5 -0
@@ -53,6 +53,11 @@#define TIOCSBRK 0x5427/* BSD compatibility */ #define TIOCCBRK 0x5428/* BSD compatibility */ #define TIOCGSID 0x5429/* Return the session ID of FD */ +#define TCGETS2 _IOR('T',0x2A, struct termios) +#define TCSETS2 _IOW('T',0x2B, struct termios) +#define TCSETSW2 _IOW('T',0x2C, struct termios) +#define TCSETSF2 _IOW('T',0x2D, struct termios) +#define TIOCGPTN _IOR('T',0x30, unsigned int)/* Get Pty Number (of pty-mux device) */ #define TIOCSPTLCK _IOW('T',0x31, int)/* Lock/unlock Pty */
include/asm-ia64/termbits.h +14 -0
@@ -17,6 +17,15 @@typedef unsigned int tcflag_t ;#define NCCS 19 +struct termios_v1 { +tcflag_t c_iflag;/* input mode flags */ +tcflag_t c_oflag;/* output mode flags */ +tcflag_t c_cflag;/* control mode flags */ +tcflag_t c_lflag;/* local mode flags */ +cc_t c_line;/* line discipline */ +cc_t c_cc[NCCS ];/* control characters */ +}; +struct termios {tcflag_t c_iflag;/* input mode flags */ tcflag_t c_oflag;/* output mode flags */
@@ -24,6 +33,8 @@tcflag_t c_lflag;/* local mode flags */ cc_t c_line;/* line discipline */ cc_t c_cc[NCCS ];/* control characters */ +speed_t c_ispeed;/* input speed */ +speed_t c_ospeed;/* output speed */ };/* c_cc characters */
@@ -127,6 +138,7 @@#define HUPCL 0002000#define CLOCAL 0004000#define CBAUDEX 0010000 +#define BOTHER 0010000/* non standard rate */ #define B57600 0010001#define B115200 0010002#define B230400 0010003
@@ -146,6 +158,8 @@#define CMSPAR 010000000000/* mark or space (stick) parity */ #define CRTSCTS 020000000000/* flow control */ +#define IBSHIFT 8/* Shift from CBAUD to CIBAUD */ +/* c_lflag bits */ #define ISIG 0000001#define ICANON 0000002
include/asm-ia64/termios.h +2 -0
@@ -105,6 +105,8 @@copy_to_user ((termio)->c_cc, (termios)->c_cc,NCC ); \ }) +#define user_termios_to_kernel_termios_1 (k, u) copy_from_user(k, u, sizeof(struct termios_1)) +#define kernel_termios_to_user_termios_1 (u, k) copy_to_user(u, k, sizeof(struct termios_1))#define user_termios_to_kernel_termios (k, u) copy_from_user(k, u, sizeof(struct termios))#define kernel_termios_to_user_termios (u, k) copy_to_user(u, k, sizeof(struct termios))
include/asm-mips/ioctls.h +6 -0
@@ -102,4 +102,10 @@#define TIOCGHAYESESP 0x5493/* Get Hayes ESP configuration */ #define TIOCSHAYESESP 0x5494/* Set Hayes ESP configuration */ +#define TCGETS2 _IOR('T',0x95, struct termios) +#define TCSETS2 _IOW('T',0x96, struct termios) +#define TCSETSW2 _IOW('T',0x97, struct termios) +#define TCSETSF2 _IOW('T',0x98, struct termios) + +#endif /* __ASM_IOCTLS_H */
include/asm-mips/termbits.h +12 -0
@@ -27,6 +27,15 @@* replacement for it in struct termio */ #define NCCS 23 +struct termios_v1 { +tcflag_t c_iflag;/* input mode flags */ +tcflag_t c_oflag;/* output mode flags */ +tcflag_t c_cflag;/* control mode flags */ +tcflag_t c_lflag;/* local mode flags */ +cc_t c_line;/* line discipline */ +cc_t c_cc[NCCS ];/* control characters */ +}; +struct termios {tcflag_t c_iflag;/* input mode flags */ tcflag_t c_oflag;/* output mode flags */
@@ -34,6 +43,8 @@tcflag_t c_lflag;/* local mode flags */ cc_t c_line;/* line discipline */ cc_t c_cc[NCCS ];/* control characters */ +speed_t c_ispeed;/* input speed */ +speed_t c_ospeed;/* output speed */ };/* c_cc characters */
@@ -148,6 +159,7 @@#define HUPCL 0002000/* Hang up on last close. */ #define CLOCAL 0004000/* Ignore modem status lines. */ #define CBAUDEX 0010000 +#define BOTHER 0010000/* non standard rate */ #define B57600 0010001#define B115200 0010002#define B230400 0010003
include/asm-mips/termios.h +2 -0
@@ -140,6 +140,8 @@copy_to_user ((termio)->c_cc, (termios)->c_cc,NCC ); \ }) +#define user_termios_to_kernel_termios_1 (k, u) copy_from_user(k, u, sizeof(struct termios_1)) +#define kernel_termios_to_user_termios_1 (u, k) copy_to_user(u, k, sizeof(struct termios_1))#define user_termios_to_kernel_termios (k, u) copy_from_user(k, u, sizeof(struct termios))#define kernel_termios_to_user_termios (u, k) copy_to_user(u, k, sizeof(struct termios))
include/asm-parisc/ioctls.h +6 -0
@@ -46,6 +46,12 @@#define TIOCSBRK 0x5427/* BSD compatibility */ #define TIOCCBRK 0x5428/* BSD compatibility */ #define TIOCGSID _IOR('T', 20, int)/* Return the session ID of FD */ + +#define TCGETS2 _IOR('T',0x2A, struct termios) +#define TCSETS2 _IOW('T',0x2B, struct termios) +#define TCSETSW2 _IOW('T',0x2C, struct termios) +#define TCSETSF2 _IOW('T',0x2D, struct termios) +#define TIOCGPTN _IOR('T',0x30, unsigned int)/* Get Pty Number (of pty-mux device) */ #define TIOCSPTLCK _IOW('T',0x31, int)/* Lock/unlock Pty */
include/asm-parisc/termbits.h +13 -0
@@ -8,6 +8,16 @@typedef unsigned int tcflag_t ;#define NCCS 19 + +struct termios_v1 { +tcflag_t c_iflag;/* input mode flags */ +tcflag_t c_oflag;/* output mode flags */ +tcflag_t c_cflag;/* control mode flags */ +tcflag_t c_lflag;/* local mode flags */ +cc_t c_line;/* line discipline */ +cc_t c_cc[NCCS ];/* control characters */ +}; +struct termios {tcflag_t c_iflag;/* input mode flags */ tcflag_t c_oflag;/* output mode flags */
@@ -15,6 +25,8 @@tcflag_t c_lflag;/* local mode flags */ cc_t c_line;/* line discipline */ cc_t c_cc[NCCS ];/* control characters */ +speed_t c_ispeed;/* input speed */ +speed_t c_ospeed;/* output speed */ };/* c_cc characters */
@@ -119,6 +131,7 @@#define HUPCL 0002000#define CLOCAL 0004000#define CBAUDEX 0010000 +#define BOTHER 0010000#define B57600 0010001#define B115200 0010002#define B230400 0010003
include/asm-parisc/termios.h +2 -0
@@ -98,6 +98,8 @@copy_to_user ((termio)->c_cc, (termios)->c_cc,NCC ); \ }) +#define user_termios_to_kernel_termios_1 (k, u) copy_from_user(k, u, sizeof(struct termios_1)) +#define kernel_termios_to_user_termios_1 (u, k) copy_to_user(u, k, sizeof(struct termios_1))#define user_termios_to_kernel_termios (k, u) copy_from_user(k, u, sizeof(struct termios))#define kernel_termios_to_user_termios (u, k) copy_to_user(u, k, sizeof(struct termios))
include/asm-powerpc/termbits.h +1 -0
@@ -139,6 +139,7 @@#define B3000000 00034#define B3500000 00035#define B4000000 00036 +#define BOTHER 00037#define CSIZE 00001400#define CS5 00000000
include/asm-sparc/ioctls.h +8 -4
@@ -11,10 +11,10 @@#define TCSBRK _IO('T', 5)#define TCXONC _IO('T', 6)#define TCFLSH _IO('T', 7) -#define TCGETS _IOR('T', 8, struct termios) -#define TCSETS _IOW('T', 9, struct termios) -#define TCSETSW _IOW('T', 10, struct termios) -#define TCSETSF _IOW('T', 11, struct termios) +#define TCGETS _IOR('T', 8, struct termios_v1) +#define TCSETS _IOW('T', 9, struct termios_v1) +#define TCSETSW _IOW('T', 10, struct termios_v1) +#define TCSETSF _IOW('T', 11, struct termios_v1)/* Note that all the ioctls that are not available in Linux have a * double underscore on the front to: a) avoid some programs to
@@ -99,6 +99,10 @@#define TIOCGSERIAL 0x541E#define TIOCSSERIAL 0x541F#define TCSBRKP 0x5425 +#define TCGETS2 _IOR('T',0x2A, struct termios) +#define TCSETS2 _IOW('T',0x2B, struct termios) +#define TCSETSW2 _IOW('T',0x2C, struct termios) +#define TCSETSF2 _IOW('T',0x2D, struct termios)#define TIOCSERCONFIG 0x5453#define TIOCSERGWILD 0x5454#define TIOCSERSWILD 0x5455
include/asm-sparc/termbits.h +19 -4
@@ -17,20 +17,34 @@unsigned char c_cc[NCC ];/* control characters */ }; -#define NCCS 17 -struct termios { +#define NCCS_V1 17 +struct termios_v1 {tcflag_t c_iflag;/* input mode flags */ tcflag_t c_oflag;/* output mode flags */ tcflag_t c_cflag;/* control mode flags */ tcflag_t c_lflag;/* local mode flags */ cc_t c_line;/* line discipline */ -cc_t c_cc[NCCS ];/* control characters */ +cc_t c_cc[NCCS_V1 ];/* control characters */ +/* We need this old compat _x_cc bits as its used to compute the ioctl number */ #ifdef __KERNEL__ -#define SIZEOF_USER_TERMIOS sizeof (struct termios) - (2*sizeof (cc_t)) +// #define SIZEOF_USER_TERMIOS sizeof (struct termios) - (2*sizeof (cc_t)) cc_t _x_cc[2 ];/* We need them to hold vmin/vtime */ #endif }; +#define NCCS 19 + +struct termios { +tcflag_t c_iflag;/* input mode flags */ +tcflag_t c_oflag;/* output mode flags */ +tcflag_t c_cflag;/* control mode flags */ +tcflag_t c_lflag;/* local mode flags */ +cc_t c_line;/* line discipline */ +cc_t c_cc[NCCS ];/* control characters */ +speed_t c_ispeed;/* input speed */ +speed_t c_ospeed;/* output speed */ +}; +/* c_cc characters */ #define VINTR 0#define VQUIT 1
@@ -147,6 +161,7 @@#define HUPCL 0x00000400#define CLOCAL 0x00000800#define CBAUDEX 0x00001000 +#define BOTHER 0x00001000/* We'll never see these speeds with the Zilogs, but for completeness... */ #define B57600 0x00001001#define B115200 0x00001002
include/asm-sparc/termios.h +7 -4
@@ -124,14 +124,14 @@0 ; \ }) -#define user_termios_to_kernel_termios (k, u) \ +#define user_termios_to_kernel_termios_v1 (k, u) \ ({ \ get_user((k)->c_iflag, &(u)->c_iflag); \ get_user((k)->c_oflag, &(u)->c_oflag); \ get_user((k)->c_cflag, &(u)->c_cflag); \ get_user((k)->c_lflag, &(u)->c_lflag); \ get_user((k)->c_line, &(u)->c_line); \ - copy_from_user((k)->c_cc, (u)->c_cc, NCCS); \ + copy_from_user((k)->c_cc, (u)->c_cc, NCCS_V1); \ if((k)->c_lflag & ICANON) { \ get_user((k)->c_cc[VEOF], &(u)->c_cc[VEOF]); \ get_user((k)->c_cc[VEOL], &(u)->c_cc[VEOL]); \
@@ -142,14 +142,14 @@0 ; \ }) -#define kernel_termios_to_user_termios (u, k) \ +#define kernel_termios_to_user_termios_v1 (u, k) \ ({ \ put_user((k)->c_iflag, &(u)->c_iflag); \ put_user((k)->c_oflag, &(u)->c_oflag); \ put_user((k)->c_cflag, &(u)->c_cflag); \ put_user((k)->c_lflag, &(u)->c_lflag); \ put_user((k)->c_line, &(u)->c_line); \ - copy_to_user((u)->c_cc, (k)->c_cc, NCCS); \ + copy_to_user((u)->c_cc, (k)->c_cc, NCCS_V1); \ if(!((k)->c_lflag & ICANON)) { \ put_user((k)->c_cc[VMIN], &(u)->c_cc[_VMIN]); \ put_user((k)->c_cc[VTIME], &(u)->c_cc[_VTIME]); \
@@ -160,6 +160,9 @@0 ; \ }) +#define user_termios_to_kernel_termios (k, u) copy_from_user(k, u, sizeof(struct termios)) +#define kernel_termios_to_user_termios (u, k) copy_to_user(u, k, sizeof(struct termios)) +#endif /* __KERNEL__ */ #endif /* _SPARC_TERMIOS_H */
include/asm-sparc64/ioctls.h +8 -4
@@ -12,10 +12,10 @@#define TCSBRK _IO('T', 5)#define TCXONC _IO('T', 6)#define TCFLSH _IO('T', 7) -#define TCGETS _IOR('T', 8, struct termios) -#define TCSETS _IOW('T', 9, struct termios) -#define TCSETSW _IOW('T', 10, struct termios) -#define TCSETSF _IOW('T', 11, struct termios) +#define TCGETS _IOR('T', 8, struct termios_v1) +#define TCSETS _IOW('T', 9, struct termios_v1) +#define TCSETSW _IOW('T', 10, struct termios_v1) +#define TCSETSF _IOW('T', 11, struct termios_v1)/* Note that all the ioctls that are not available in Linux have a * double underscore on the front to: a) avoid some programs to
@@ -100,6 +100,10 @@#define TIOCGSERIAL 0x541E#define TIOCSSERIAL 0x541F#define TCSBRKP 0x5425 +#define TCGETS2 _IOR('T',0x2A, struct termios) +#define TCSETS2 _IOW('T',0x2B, struct termios) +#define TCSETSW2 _IOW('T',0x2C, struct termios) +#define TCSETSF2 _IOW('T',0x2D, struct termios)#define TIOCSERCONFIG 0x5453#define TIOCSERGWILD 0x5454#define TIOCSERSWILD 0x5455
include/asm-sparc64/termbits.h +18 -3
@@ -19,20 +19,34 @@unsigned char c_cc[NCC ];/* control characters */ }; -#define NCCS 17 -struct termios { +#define NCCS_v1 17 +struct termios_v1 {tcflag_t c_iflag;/* input mode flags */ tcflag_t c_oflag;/* output mode flags */ tcflag_t c_cflag;/* control mode flags */ tcflag_t c_lflag;/* local mode flags */ cc_t c_line;/* line discipline */ cc_t c_cc[NCCS ];/* control characters */ +/* We need this old compat _x_cc bits as its used to compute the ioctl number */ #ifdef __KERNEL__ -#define SIZEOF_USER_TERMIOS sizeof (struct termios) - (2*sizeof (cc_t)) +//#define SIZEOF_USER_TERMIOS sizeof (struct termios) - (2*sizeof (cc_t)) cc_t _x_cc[2 ];/* We need them to hold vmin/vtime */ #endif }; +#define NCCS 19 + +struct termios { +tcflag_t c_iflag;/* input mode flags */ +tcflag_t c_oflag;/* output mode flags */ +tcflag_t c_cflag;/* control mode flags */ +tcflag_t c_lflag;/* local mode flags */ +cc_t c_line;/* line discipline */ +cc_t c_cc[NCCS ];/* control characters */ +speed_t c_ispeed;/* input speed */ +speed_t c_ospeed;/* output speed */ +}; +/* c_cc characters */ #define VINTR 0#define VQUIT 1
@@ -149,6 +163,7 @@#define HUPCL 0x00000400#define CLOCAL 0x00000800#define CBAUDEX 0x00001000 +#define BOTHER 0x00001000#define B57600 0x00001001#define B115200 0x00001002#define B230400 0x00001003
include/asm-sparc64/termios.h +2 -2
@@ -133,7 +133,7 @@ err |=get_user ((k)->c_cflag, &(u)->c_cflag); \ err |=get_user ((k)->c_lflag, &(u)->c_lflag); \ err |=get_user ((k)->c_line, &(u)->c_line); \ - err |=copy_from_user ((k)->c_cc, (u)->c_cc,NCCS ); \ + err |=copy_from_user ((k)->c_cc, (u)->c_cc,NCCS_V1 ); \if ((k)->c_lflag &ICANON ) { \ err |=get_user ((k)->c_cc[VEOF ], &(u)->c_cc[VEOF ]); \ err |=get_user ((k)->c_cc[VEOL ], &(u)->c_cc[VEOL ]); \
@@ -152,7 +152,7 @@ err |=put_user ((k)->c_cflag, &(u)->c_cflag); \ err |=put_user ((k)->c_lflag, &(u)->c_lflag); \ err |=put_user ((k)->c_line, &(u)->c_line); \ - err |=copy_to_user ((u)->c_cc, (k)->c_cc,NCCS ); \ + err |=copy_to_user ((u)->c_cc, (k)->c_cc,NCCS_V1 ); \if (!((k)->c_lflag &ICANON )) { \ err |=put_user ((k)->c_cc[VMIN ], &(u)->c_cc[_VMIN]); \ err |=put_user ((k)->c_cc[VTIME ], &(u)->c_cc[_VTIME]); \
include/asm-x86_64/ioctls.h +6 -0
@@ -46,6 +46,12 @@#define TIOCSBRK 0x5427/* BSD compatibility */ #define TIOCCBRK 0x5428/* BSD compatibility */ #define TIOCGSID 0x5429/* Return the session ID of FD */ + +#define TCGETS2 _IOR('T',0x2A, struct termios) +#define TCSETS2 _IOW('T',0x2B, struct termios) +#define TCSETSW2 _IOW('T',0x2C, struct termios) +#define TCSETSF2 _IOW('T',0x2D, struct termios) +#define TIOCGPTN _IOR('T',0x30, unsigned int)/* Get Pty Number (of pty-mux device) */ #define TIOCSPTLCK _IOW('T',0x31, int)/* Lock/unlock Pty */
include/asm-x86_64/termbits.h +15 -0
@@ -8,6 +8,15 @@typedef unsigned int tcflag_t ;#define NCCS 19 +struct termios_v1 { +tcflag_t c_iflag;/* input mode flags */ +tcflag_t c_oflag;/* output mode flags */ +tcflag_t c_cflag;/* control mode flags */ +tcflag_t c_lflag;/* local mode flags */ +cc_t c_line;/* line discipline */ +cc_t c_cc[NCCS ];/* control characters */ +}; +struct termios {tcflag_t c_iflag;/* input mode flags */ tcflag_t c_oflag;/* output mode flags */
@@ -15,8 +24,11 @@tcflag_t c_lflag;/* local mode flags */ cc_t c_line;/* line discipline */ cc_t c_cc[NCCS ];/* control characters */ +speed_t c_ispeed;/* input speed */ +speed_t c_ospeed;/* output speed */ }; +/* c_cc characters */ #define VINTR 0#define VQUIT 1
@@ -118,6 +130,7 @@#define HUPCL 0002000#define CLOCAL 0004000#define CBAUDEX 0010000 +#define BOTHER 0010000/* non standard rate */ #define B57600 0010001#define B115200 0010002#define B230400 0010003
@@ -137,6 +150,8 @@#define CMSPAR 010000000000/* mark or space (stick) parity */ #define CRTSCTS 020000000000/* flow control */ +#define IBSHIFT 8/* Shift from CBAUD to CIBAUD */ +/* c_lflag bits */ #define ISIG 0000001#define ICANON 0000002
include/asm-x86_64/termios.h +2 -0
@@ -98,6 +98,8 @@copy_to_user ((termio)->c_cc, (termios)->c_cc,NCC ); \ }) +#define user_termios_to_kernel_termios_1 (k, u) copy_from_user(k, u, sizeof(struct termios_v1)) +#define kernel_termios_to_user_termios_1 (u, k) copy_to_user(u, k, sizeof(struct termios_v1))#define user_termios_to_kernel_termios (k, u) copy_from_user(k, u, sizeof(struct termios))#define kernel_termios_to_user_termios (u, k) copy_to_user(u, k, sizeof(struct termios))
include/linux/tty.h +3 -2
@@ -294,8 +294,9 @@extern void do_SAK (struct tty_struct *tty);extern void disassociate_ctty (int priv);extern void tty_flip_buffer_push (struct tty_struct *tty); -extern int tty_get_baud_rate (struct tty_struct *tty); -extern int tty_termios_baud_rate (struct termios *termios); +extern speed_t tty_get_baud_rate (struct tty_struct *tty); +extern speed_t tty_termios_baud_rate (struct termios *termios); +extern speed_t tty_termios_input_baud_rate (struct termios *termios);extern struct tty_ldisc *tty_ldisc_ref (struct tty_struct *);extern void tty_ldisc_deref (struct tty_ldisc *);
include/asm-i386/ioctls.h line 54
Quoted 5 lines · Alan Cox
include/asm-i386/ioctls.h +5
-0+ +#define TCGETS2 _IOR('T',0x2A, struct termios) +#define TCSETS2 _IOW('T',0x2B, struct termios) +#define TCSETSW2 _IOW('T',0x2C, struct termios) +#define TCSETSF2 _IOW('T',0x2D, struct termios)
So existing code compiled against this will be using the new 'struct termios' but the old TCGETS. Should we rename the existing ioctl to TCGETS_OLD, and have TCGETS be the new one?
I suppose to a large extent it doesn't really matter as long as existing C libraries happen to get it right -- and since the new structure only has the new field added, the discrepancy shouldn't matter _too_ much. But still...
Signature · 1 line
dwmw2
Ar Sul, 2006-09-10 am 11:46 +0100, ysgrifennodd David Woodhouse:
Quoted 10 lines · Alan Cox
include/asm-i386/ioctls.h line 54
Quoted 5 lines
include/asm-i386/ioctls.h +5
-0+ +#define TCGETS2 _IOR('T',0x2A, struct termios) +#define TCSETS2 _IOW('T',0x2B, struct termios) +#define TCSETSW2 _IOW('T',0x2C, struct termios) +#define TCSETSF2 _IOW('T',0x2D, struct termios)So existing code compiled against this will be using the new 'struct termios' but the old TCGETS. Should we rename the existing ioctl to
TCGETS_OLD, and have TCGETS be the new one?
Kernel headers are not intended for user space. In this case the struct termios presented by glibc already differs from the termios presented by the kernel so the problem doesn't arise at all.
Alan
Quoted 3 lines · Alan Cox
Kernel headers are not intended for user space. In this case the struct termios presented by glibc already differs from the termios presented by the kernel so the problem doesn't arise at all.
Please note that we are moving away from the mindless repetition of that phrase, and moving towards a system where we actually _mean_ it.
If you really don't want asm/term{bit,io}s.h to be visible in userspace, then the way to express that is to provide a patch to include/asm-generic/Kbuild which removes them from the export.
I don't think I agree -- I think these files _do_ provide part of the kernel<->user ABI and should be kept. You're right that userspace in _general_ shouldn't be touching them -- as I said, it's only really the C libraries that are important here. As long as _they_ get it right when built against the headers with your changes, we're fine.
But I don't think it's realistic to suggest that C libraries should be built without access to our asm/term{bit,io}s.h at all. However, I'm only really responsible for the new export _mechanism_ -- I'm not going to impose policy except when people like Andi do stupid things and sneakily send private patches to undo fixes I've already made.
So if you want to unexport those headers and make sure the C libraries work like that, please do go ahead -- but don't just _say_ it, _do_ it -- and please do make sure that at _least_ glibc still builds afterwards.
Signature · 1 line
dwmw2
Ar Sul, 2006-09-10 am 12:20 +0100, ysgrifennodd David Woodhouse:
Quoted 5 lines
But I don't think it's realistic to suggest that C libraries should be built without access to our
asm/term{bit,io}s.hat all. However, I'm only really responsible for the new export _mechanism_ -- I'm not going to impose policy except when people like Andi do stupid things and sneakily send private patches to undo fixes I've already made.
glibc needs them, nobody else does.
The point I was trying to make is that user space (except glibc) does not use them. glibc presents a different struct termios to them already, and it always includes c_ispeed/c_ospeed.
Alan
Quoted 5 lines · Alan Cox
glibc needs them, nobody else does.
The point I was trying to make is that user space (except glibc) does not use them. glibc presents a different struct termios to them already, and it always includes c_ispeed/c_ospeed.
That's not the point. The question is what glibc's _implementation_ uses for doing the ioctls. It has to have _some_ definition of the kernel's version of the structure.
In fact it seems to have its own 'kernel_termios.h' which is an old copy of our headers. So in that case, we really can drop <asm/termios.h> from the export -- as least as far as glibc is concerned. I'm not sure about other C libraries.
On the other hand, the kind of change you're making is an example of why we might want glibc to be using a _sanely_ exported copy of our headers directly, rather than an out-of-date version of its own. But that's a policy decision I'll leave to you.
If you want to declare that asm/termios.h isn't to be exported even for glibc builds then please drop all __KERNEL__ from it and remove it from include/asm-generic/Kbuild.asm so that it isn't exported.
Signature · 1 line
dwmw2
Arnd Bergmann
maintainerAm Sunday 10 September 2006 14:24 schrieb Alan Cox:
Quoted 7 lines
Quoted 5 lines
But I don't think it's realistic to suggest that C libraries should be built without access to our
asm/term{bit,io}s.hat all. However, I'm only really responsible for the new export _mechanism_ -- I'm not going to impose policy except when people like Andi do stupid things and sneakily send private patches to undo fixes I've already made.glibc needs them, nobody else does.
strace also needs all ioctl numbers.
Arnd <><
Quoted 1 line · Alan Cox
glibc needs them, nobody else does.
And uClibc, though that's a glibc equivalent.
David