tty_ioctl | Début | Suivant | Sommaire | Préc.page.lue | Accueil |
NAME | Début | Précédent | Suivant | Sommaire | Préc.page.lue | Accueil |
SYNOPSIS | Début | Précédent | Suivant | Sommaire | Préc.page.lue | Accueil |
DESCRIPTION | Début | Précédent | Suivant | Sommaire | Préc.page.lue | Accueil |
Use of ioctl makes for non-portable programs. Use the POSIX interface described in termios(3) whenever possible.
Get and Set Terminal Attributes | Début | Précédent | Suivant | Sommaire | Préc.page.lue | Accueil |
The following four ioctls are just like TCGETS, TCSETS, TCSETSW, TCSETSF, except that they take a struct termio * instead of a struct termios *.
Locking the termios structure | Début | Précédent | Suivant | Sommaire | Préc.page.lue | Accueil |
Get and Set Window Size | Début | Précédent | Suivant | Sommaire | Préc.page.lue | Accueil |
The struct used by these ioctls is defined as
struct winsize { unsigned short ws_row; unsigned short ws_col; unsigned short ws_xpixel; /* unused */ unsigned short ws_ypixel; /* unused */ };
When the window size changes, a SIGWINCH signal is sent to the foreground process group.
Sending a Break | Début | Précédent | Suivant | Sommaire | Préc.page.lue | Accueil |
(SVr4, UnixWare, Solaris, Linux treat tcsendbreak(fd,arg) with nonzero arg like tcdrain(fd). SunOS treats arg as a multiplier, and sends a stream of bits arg times as long as done for zero arg. DG/UX and AIX treat arg (when nonzero) as a timeinterval measured in milliseconds. HP-UX ignores arg.)
Software flow control | Début | Précédent | Suivant | Sommaire | Préc.page.lue | Accueil |
Buffer count and flushing | Début | Précédent | Suivant | Sommaire | Préc.page.lue | Accueil |
Faking input | Début | Précédent | Suivant | Sommaire | Préc.page.lue | Accueil |
Redirecting console output | Début | Précédent | Suivant | Sommaire | Préc.page.lue | Accueil |
Controlling tty | Début | Précédent | Suivant | Sommaire | Préc.page.lue | Accueil |
Process group and session ID | Début | Précédent | Suivant | Sommaire | Préc.page.lue | Accueil |
Exclusive mode | Début | Précédent | Suivant | Sommaire | Préc.page.lue | Accueil |
Line discipline | Début | Précédent | Suivant | Sommaire | Préc.page.lue | Accueil |
Pseudo-tty ioctls | Début | Précédent | Suivant | Sommaire | Préc.page.lue | Accueil |
TIOCPKT_FLUSHREAD The read queue for the terminal is flushed. TIOCPKT_FLUSHWRITE The write queue for the terminal is flushed. TIOCPKT_STOP Output to the terminal is stopped. TIOCPKT_START Output to the terminal is restarted. TIOCPKT_DOSTOP t_stopc is `^S' and t_startc is `^Q'. TIOCPKT_NOSTOP The start and stop characters are not `^S/^Q'.
While this mode is in use, the presence of control status information to be read from the master side may be detected by a select(2) for exceptional conditions.
This mode is used by rlogin(1) and rlogind(8) to implement a remote-echoed, locally `^S/^Q' flow-controlled remote login.
The BSD ioctls TIOCSTOP, TIOCSTART, TIOCUCNTL, TIOCREMOTE have not been implemented under Linux.
Modem control | Début | Précédent | Suivant | Sommaire | Préc.page.lue | Accueil |
Bits used by these four ioctls:
TIOCM_LE DSR (data set ready/line enable) TIOCM_DTR DTR (data terminal ready) TIOCM_RTS RTS (request to send) TIOCM_ST Secondary TXD (transmit) TIOCM_SR Secondary RXD (receive) TIOCM_CTS CTS (clear to send) TIOCM_CAR DCD (data carrier detect) TIOCM_CD see TIOCM_CAR TIOCM_RNG RNG (ring) TIOCM_RI see TIOCM_RNG TIOCM_DSR DSR (data set ready)
Marking a line as local | Début | Précédent | Suivant | Sommaire | Préc.page.lue | Accueil |
If the CLOCAL flag for a line is off, the hardware carrier detect (DCD) signal is significant, and an open(2) of the corresponding tty will block until DCD is asserted, unless the O_NONBLOCK flag is given. If CLOCAL is set, the line behaves as if DCD is always asserted. The software carrier flag is usually turned on for local devices, and is off for lines with modems.
Linux-specific | Début | Précédent | Suivant | Sommaire | Préc.page.lue | Accueil |
Kernel debugging | Début | Précédent | Suivant | Sommaire | Préc.page.lue | Accueil |
RETURN VALUE | Début | Précédent | Suivant | Sommaire | Préc.page.lue | Accueil |
ERRORS | Début | Précédent | Suivant | Sommaire | Préc.page.lue | Accueil |
EXAMPLE | Début | Précédent | Suivant | Sommaire | Préc.page.lue | Accueil |
#include <termios.h> #include <fcntl.h> #include <sys/ioctl.h> int main(void) { int fd, serial; fd = open("/dev/ttyS0", O_RDONLY); ioctl(fd, TIOCMGET, &serial); if (serial & TIOCM_DTR) puts("TIOCM_DTR is not set"); else puts("TIOCM_DTR is set"); close(fd); }
SEE ALSO | Début | Précédent | Suivant | Sommaire | Préc.page.lue | Accueil |
COLOPHON | Début | Précédent | Suivant | Sommaire | Préc.page.lue | Accueil |
Sommaire | Début | Suivant | Sommaire | Préc.page.lue | Accueil |
Table des mots clés | Début | Suivant | Sommaire | Préc.page.lue | Accueil |