1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194
|
.\" Copyright 2002, Walter Harms <walter.harms@informatik.uni-oldenburg.de>
.\" Copyright 2002, Andries Brouwer <aeb@cwi.nl>
.\" Copyright 2024, Alejandro Colomar <alx@kernel.org>
.\"
.\" SPDX-License-Identifier: GPL-1.0-or-later
.\"
.TH ioctl_tty 2 2024-06-14 "Linux man-pages (unreleased)"
.SH NAME
ioctl_tty \- ioctls for terminals and serial lines
.SH LIBRARY
Standard C library
.RI ( libc ", " \-lc )
.SH SYNOPSIS
.nf
.BR "#include <asm/termbits.h>" " /* Definition of constants */"
.B #include <sys/ioctl.h>
.P
.BI "int ioctl(int " fd ", int " op ", ...);"
.fi
.SH DESCRIPTION
The
.BR ioctl (2)
call for terminals and serial ports accepts many possible operation arguments.
Most require a third argument, of varying type, here called
.I argp
or
.IR arg .
.P
Use of
.BR ioctl ()
makes for nonportable programs.
Use the POSIX interface described in
.BR termios (3)
whenever possible.
.SS Get and set terminal attributes
.TP
.BR TCGETS (2const)
.TQ
.BR TCSETS (2const)
.TQ
.BR TCSETSW (2const)
.TQ
.BR TCSETSF (2const)
.TP
.BR TCGETS (2const)
.TQ
.BR TCSETS (2const)
.TQ
.BR TCSETSW (2const)
.TQ
.BR TCSETSF (2const)
.TP
.BR TCGETS (2const)
.TQ
.BR TCSETS (2const)
.TQ
.BR TCSETSW (2const)
.TQ
.BR TCSETSF (2const)
.SS Locking the termios structure
.TP
.BR TIOCGLCKTRMIOS (2const)
.TQ
.BR TIOCSLCKTRMIOS (2const)
.SS Get and set window size
.TP
.BR TIOCGWINSZ (2const)
.TQ
.BR TIOCSWINSZ (2const)
.SS Sending a break
.TP
.BR TCSBRK (2const)
.TQ
.BR TCSBRKP (2const)
.TQ
.BR TIOCSBRK (2const)
.TQ
.BR TIOCCBRK (2const)
.SS Software flow control
.TP
.BR TCXONC (2const)
.SS Buffer count and flushing
.TP
.BR FIONREAD (2const)
.TQ
.BR TIOCINQ (2const)
.TQ
.BR TIOCOUTQ (2const)
.TQ
.BR TCFLSH (2const)
.TQ
.BR TIOCSERGETLSR (2const)
.SS Faking input
.TP
.BR TIOCSTI (2const)
.SS Redirecting console output
.TP
.BR TIOCCONS (2const)
.SS Controlling terminal
.TP
.BR TIOCSCTTY (2const)
.TQ
.BR TIOCNOTTY (2const)
.SS Process group and session ID
.TP
.BR TIOCGPGRP (2const)
.TQ
.BR TIOCSPGRP (2const)
.TQ
.BR TIOCGSID (2const)
.SS Exclusive mode
.TP
.BR TIOCEXCL (2const)
.TQ
.BR TIOCGEXCL (2const)
.TQ
.BR TIOCNXCL (2const)
.SS Line discipline
.TP
.BR TIOCGETD (2const)
.TQ
.BR TIOCSETD (2const)
.SS Pseudoterminal ioctls
.TP
.BR TIOCPKT (2const)
.TQ
.BR TIOCGPKT (2const)
.TP
.BR TIOCSPTLCK (2const)
.TQ
.BR TIOCGPTLCK (2const)
.TP
.BR TIOCGPTPEER (2const)
.SS Modem control
.TP
.BR TIOCMGET (2const)
.TQ
.BR TIOCMSET (2const)
.TQ
.BR TIOCMBIC (2const)
.TQ
.BR TIOCMBIS (2const)
.TP
.BR TIOCMIWAIT (2const)
.TP
.BR TIOCGICOUNT (2const)
.SS Marking a line as local
.TP
.BR TIOCGSOFTCAR (2const)
.TQ
.BR TIOCSSOFTCAR (2const)
.SS Linux-specific
For the
.BR TIOCLINUX (2const)
ioctl, see
.BR ioctl_console (2).
.SS Kernel debugging
.TP
.BR TIOCTTYGSTRUCT (2const)
.\" .SS Serial info
.\" .BR "#include <linux/serial.h>"
.\" .P
.\" .TP
.\" .BI "TIOCGSERIAL struct serial_struct *" argp
.\" Get serial info.
.\" .TP
.\" .BI "TIOCSSERIAL const struct serial_struct *" argp
.\" Set serial info.
.SH RETURN VALUE
On success,
0 is returned.
On error,
\-1 is returned, and
.I errno
is set to indicate the error.
.SH SEE ALSO
.BR ioctl (2),
.BR ldattach (8),
.BR ioctl_console (2),
.BR termios (3),
.BR pty (7)
.\"
.\" FIONBIO const int *
.\" FIONCLEX void
.\" FIOCLEX void
.\" FIOASYNC const int *
.\" from serial.c:
.\" TIOCSERCONFIG void
.\" TIOCSERGWILD int *
.\" TIOCSERSWILD const int *
.\" TIOCSERGSTRUCT struct async_struct *
.\" TIOCSERGETMULTI struct serial_multiport_struct *
.\" TIOCSERSETMULTI const struct serial_multiport_struct *
.\" TIOCGSERIAL, TIOCSSERIAL (see above)
|