mirror of https://github.com/mkerrisk/man-pages
ioctl_tty.2: Reformat argument type information
The current mark-up renders poorly. To resolve this, move the type information into a separate line. Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
parent
6d1a711b69
commit
2858b5b5ef
215
man2/ioctl_tty.2
215
man2/ioctl_tty.2
|
@ -31,26 +31,38 @@ Use the POSIX interface described in
|
|||
whenever possible.
|
||||
.SS Get and set terminal attributes
|
||||
.TP
|
||||
.BI "TCGETS struct termios *" argp
|
||||
.B TCGETS
|
||||
Argument:
|
||||
.BI "struct termios *" argp
|
||||
.IP
|
||||
Equivalent to
|
||||
.IR "tcgetattr(fd, argp)" .
|
||||
.IP
|
||||
Get the current serial port settings.
|
||||
.TP
|
||||
.BI "TCSETS const struct termios *" argp
|
||||
.B TCSETS
|
||||
Argument:
|
||||
.BI "const struct termios *" argp
|
||||
.IP
|
||||
Equivalent to
|
||||
.IR "tcsetattr(fd, TCSANOW, argp)" .
|
||||
.IP
|
||||
Set the current serial port settings.
|
||||
.TP
|
||||
.BI "TCSETSW const struct termios *" argp
|
||||
.B TCSETSW
|
||||
Argument:
|
||||
.BI "const struct termios *" argp
|
||||
.IP
|
||||
Equivalent to
|
||||
.IR "tcsetattr(fd, TCSADRAIN, argp)" .
|
||||
.IP
|
||||
Allow the output buffer to drain, and
|
||||
set the current serial port settings.
|
||||
.TP
|
||||
.BI "TCSETSF const struct termios *" argp
|
||||
.B TCSETSF
|
||||
Argument:
|
||||
.BI "const struct termios *" argp
|
||||
.IP
|
||||
Equivalent to
|
||||
.IR "tcsetattr(fd, TCSAFLUSH, argp)" .
|
||||
.IP
|
||||
|
@ -83,12 +95,18 @@ The lock is itself a
|
|||
structure, with nonzero bits or fields indicating a
|
||||
locked value.
|
||||
.TP
|
||||
.BI "TIOCGLCKTRMIOS struct termios *" argp
|
||||
.B TIOCGLCKTRMIOS
|
||||
Argument:
|
||||
.BI "struct termios *" argp
|
||||
.IP
|
||||
Gets the locking status of the
|
||||
.I termios
|
||||
structure of the terminal.
|
||||
.TP
|
||||
.BI "TIOCSLCKTRMIOS const struct termios *" argp
|
||||
.B TIOCSLCKTRMIOS
|
||||
Argument:
|
||||
.BI "const struct termios *" argp
|
||||
.IP
|
||||
Sets the locking status of the
|
||||
.I termios
|
||||
structure of the terminal.
|
||||
|
@ -104,10 +122,16 @@ for example, by loading a new font).
|
|||
The following constants and structure are defined in
|
||||
.IR <sys/ioctl.h> .
|
||||
.TP
|
||||
.BI "TIOCGWINSZ struct winsize *" argp
|
||||
.B TIOCGWINSZ
|
||||
Argument:
|
||||
.BI "struct winsize *" argp
|
||||
.IP
|
||||
Get window size.
|
||||
.TP
|
||||
.BI "TIOCSWINSZ const struct winsize *" argp
|
||||
.B TIOCSWINSZ
|
||||
Argument:
|
||||
.BI "const struct winsize *" argp
|
||||
.IP
|
||||
Set window size.
|
||||
.PP
|
||||
The struct used by these ioctls is defined as
|
||||
|
@ -129,7 +153,10 @@ signal is sent to the
|
|||
foreground process group.
|
||||
.SS Sending a break
|
||||
.TP
|
||||
.BI "TCSBRK int " arg
|
||||
.B TCSBRK
|
||||
Argument:
|
||||
.BI "int " arg
|
||||
.IP
|
||||
Equivalent to
|
||||
.IR "tcsendbreak(fd, arg)" .
|
||||
.IP
|
||||
|
@ -162,7 +189,10 @@ DG/UX and AIX treat
|
|||
HP-UX ignores
|
||||
.IR arg .)
|
||||
.TP
|
||||
.BI "TCSBRKP int " arg
|
||||
.B TCSBRKP
|
||||
Argument:
|
||||
.BI "int " arg
|
||||
.IP
|
||||
So-called "POSIX version" of
|
||||
.BR TCSBRK .
|
||||
It treats nonzero
|
||||
|
@ -170,14 +200,23 @@ It treats nonzero
|
|||
as a time interval measured in deciseconds, and does nothing
|
||||
when the driver does not support breaks.
|
||||
.TP
|
||||
.B "TIOCSBRK void"
|
||||
.B "TIOCSBRK
|
||||
Argument:
|
||||
.BI "void"
|
||||
.IP
|
||||
Turn break on, that is, start sending zero bits.
|
||||
.TP
|
||||
.B "TIOCCBRK void"
|
||||
.B "TIOCCBRK
|
||||
Argument:
|
||||
.BI "void"
|
||||
.IP
|
||||
Turn break off, that is, stop sending zero bits.
|
||||
.SS Software flow control
|
||||
.TP
|
||||
.BI "TCXONC int " arg
|
||||
.B TCXONC
|
||||
Argument:
|
||||
.BI "int " arg
|
||||
.IP
|
||||
Equivalent to
|
||||
.IR "tcflow(fd, arg)" .
|
||||
.IP
|
||||
|
@ -190,17 +229,29 @@ for the argument values
|
|||
.BR TCION .
|
||||
.SS Buffer count and flushing
|
||||
.TP
|
||||
.BI "FIONREAD int *" argp
|
||||
.BI "FIONREAD
|
||||
Argument:
|
||||
.BI "int *" argp
|
||||
.IP
|
||||
Get the number of bytes in the input buffer.
|
||||
.TP
|
||||
.BI "TIOCINQ int *" argp
|
||||
.B TIOCINQ
|
||||
Argument:
|
||||
.BI "int *" argp
|
||||
.IP
|
||||
Same as
|
||||
.BR FIONREAD .
|
||||
.TP
|
||||
.BI "TIOCOUTQ int *" argp
|
||||
.B TIOCOUTQ
|
||||
Argument:
|
||||
.BI "int *" argp
|
||||
.IP
|
||||
Get the number of bytes in the output buffer.
|
||||
.TP
|
||||
.BI "TCFLSH int " arg
|
||||
.B TCFLSH
|
||||
Argument:
|
||||
.BI "int " arg
|
||||
.IP
|
||||
Equivalent to
|
||||
.IR "tcflush(fd, arg)" .
|
||||
.IP
|
||||
|
@ -212,11 +263,17 @@ for the argument values
|
|||
.BR TCIOFLUSH .
|
||||
.SS Faking input
|
||||
.TP
|
||||
.BI "TIOCSTI const char *" argp
|
||||
.B TIOCSTI
|
||||
Argument:
|
||||
.BI "const char *" argp
|
||||
.IP
|
||||
Insert the given byte in the input queue.
|
||||
.SS Redirecting console output
|
||||
.TP
|
||||
.B "TIOCCONS void"
|
||||
.B "TIOCCONS
|
||||
Argument:
|
||||
.BI "void"
|
||||
.IP
|
||||
Redirect output that would have gone to
|
||||
.I /dev/console
|
||||
or
|
||||
|
@ -239,7 +296,10 @@ or
|
|||
.IR /dev/tty0 .
|
||||
.SS Controlling terminal
|
||||
.TP
|
||||
.BI "TIOCSCTTY int " arg
|
||||
.B TIOCSCTTY
|
||||
Argument:
|
||||
.BI "int " arg
|
||||
.IP
|
||||
Make the given terminal the controlling terminal of the calling process.
|
||||
The calling process must be a session leader and not have a
|
||||
controlling terminal already.
|
||||
|
@ -257,7 +317,10 @@ capability and
|
|||
equals 1, in which case the terminal is stolen, and all processes that had
|
||||
it as controlling terminal lose it.
|
||||
.TP
|
||||
.B "TIOCNOTTY void"
|
||||
.B "TIOCNOTTY
|
||||
Argument:
|
||||
.BI "void"
|
||||
.IP
|
||||
If the given terminal was the controlling terminal of the calling process,
|
||||
give up this controlling terminal.
|
||||
If the process was session leader,
|
||||
|
@ -269,19 +332,28 @@ to the foreground process group
|
|||
and all processes in the current session lose their controlling terminal.
|
||||
.SS Process group and session ID
|
||||
.TP
|
||||
.BI "TIOCGPGRP pid_t *" argp
|
||||
.B TIOCGPGRP
|
||||
Argument:
|
||||
.BI "pid_t *" argp
|
||||
.IP
|
||||
When successful, equivalent to
|
||||
.IR "*argp = tcgetpgrp(fd)" .
|
||||
.IP
|
||||
Get the process group ID of the foreground process group on this terminal.
|
||||
.TP
|
||||
.BI "TIOCSPGRP const pid_t *" argp
|
||||
.B TIOCSPGRP
|
||||
Argument:
|
||||
.BI "const pid_t *" argp
|
||||
.IP
|
||||
Equivalent to
|
||||
.IR "tcsetpgrp(fd, *argp)" .
|
||||
.IP
|
||||
Set the foreground process group ID of this terminal.
|
||||
.TP
|
||||
.BI "TIOCGSID pid_t *" argp
|
||||
.B TIOCGSID
|
||||
Argument:
|
||||
.BI "pid_t *" argp
|
||||
.IP
|
||||
Get the session ID of the given terminal.
|
||||
This fails with the error
|
||||
.B ENOTTY
|
||||
|
@ -290,7 +362,10 @@ and not our controlling terminal.
|
|||
Strange.
|
||||
.SS Exclusive mode
|
||||
.TP
|
||||
.B "TIOCEXCL void"
|
||||
.B "TIOCEXCL
|
||||
Argument:
|
||||
.BI "void"
|
||||
.IP
|
||||
Put the terminal into exclusive mode.
|
||||
No further
|
||||
.BR open (2)
|
||||
|
@ -301,7 +376,10 @@ except for a process with the
|
|||
.BR CAP_SYS_ADMIN
|
||||
capability.)
|
||||
.TP
|
||||
.BI "TIOCGEXCL int *" argp
|
||||
.B TIOCGEXCL
|
||||
Argument:
|
||||
.BI "int *" argp
|
||||
.IP
|
||||
(since Linux 3.8)
|
||||
If the terminal is currently in exclusive mode,
|
||||
place a nonzero value in the location pointed to by
|
||||
|
@ -309,18 +387,30 @@ place a nonzero value in the location pointed to by
|
|||
otherwise, place zero in
|
||||
.IR *argp .
|
||||
.TP
|
||||
.B "TIOCNXCL void"
|
||||
.B "TIOCNXCL
|
||||
Argument:
|
||||
.BI "void"
|
||||
.IP
|
||||
Disable exclusive mode.
|
||||
.SS Line discipline
|
||||
.TP
|
||||
.BI "TIOCGETD int *" argp
|
||||
.B TIOCGETD
|
||||
Argument:
|
||||
.BI "int *" argp
|
||||
.IP
|
||||
Get the line discipline of the terminal.
|
||||
.TP
|
||||
.BI "TIOCSETD const int *" argp
|
||||
.B TIOCSETD
|
||||
Argument:
|
||||
.BI "const int *" argp
|
||||
.IP
|
||||
Set the line discipline of the terminal.
|
||||
.SS Pseudoterminal ioctls
|
||||
.TP
|
||||
.BI "TIOCPKT const int *" argp
|
||||
.B TIOCPKT
|
||||
Argument:
|
||||
.BI "const int *" argp
|
||||
.IP
|
||||
Enable (when
|
||||
.RI * argp
|
||||
is nonzero) or disable packet mode.
|
||||
|
@ -378,12 +468,18 @@ and
|
|||
to implement a remote-echoed,
|
||||
locally \fB\(haS\fP/\fB\(haQ\fP flow-controlled remote login.
|
||||
.TP
|
||||
.BI "TIOCGPKT const int *" argp
|
||||
.B TIOCGPKT
|
||||
Argument:
|
||||
.BI "const int *" argp
|
||||
.IP
|
||||
(since Linux 3.8)
|
||||
Return the current packet mode setting in the integer pointed to by
|
||||
.IR argp .
|
||||
.TP
|
||||
.BI "TIOCSPTLCK int *" argp
|
||||
.B TIOCSPTLCK
|
||||
Argument:
|
||||
.BI "int *" argp
|
||||
.IP
|
||||
Set (if
|
||||
.IR *argp
|
||||
is nonzero) or remove (if
|
||||
|
@ -392,13 +488,19 @@ is zero) the lock on the pseudoterminal slave device.
|
|||
(See also
|
||||
.BR unlockpt (3).)
|
||||
.TP
|
||||
.BI "TIOCGPTLCK int *" argp
|
||||
.B TIOCGPTLCK
|
||||
Argument:
|
||||
.BI "int *" argp
|
||||
.IP
|
||||
(since Linux 3.8)
|
||||
Place the current lock state of the pseudoterminal slave device
|
||||
in the location pointed to by
|
||||
.IR argp .
|
||||
.TP
|
||||
.BI "TIOCGPTPEER int " flags
|
||||
.B TIOCGPTPEER
|
||||
Argument:
|
||||
.BI "int " flags
|
||||
.IP
|
||||
.\" commit 54ebbfb1603415d9953c150535850d30609ef077
|
||||
(since Linux 4.13)
|
||||
Given a file descriptor in
|
||||
|
@ -432,16 +534,28 @@ The BSD ioctls
|
|||
have not been implemented under Linux.
|
||||
.SS Modem control
|
||||
.TP
|
||||
.BI "TIOCMGET int *" argp
|
||||
.B TIOCMGET
|
||||
Argument:
|
||||
.BI "int *" argp
|
||||
.IP
|
||||
Get the status of modem bits.
|
||||
.TP
|
||||
.BI "TIOCMSET const int *" argp
|
||||
.B TIOCMSET
|
||||
Argument:
|
||||
.BI "const int *" argp
|
||||
.IP
|
||||
Set the status of modem bits.
|
||||
.TP
|
||||
.BI "TIOCMBIC const int *" argp
|
||||
.B TIOCMBIC
|
||||
Argument:
|
||||
.BI "const int *" argp
|
||||
.IP
|
||||
Clear the indicated modem bits.
|
||||
.TP
|
||||
.BI "TIOCMBIS const int *" argp
|
||||
.B TIOCMBIS
|
||||
Argument:
|
||||
.BI "const int *" argp
|
||||
.IP
|
||||
Set the indicated modem bits.
|
||||
.PP
|
||||
The following bits are used by the above ioctls:
|
||||
|
@ -461,7 +575,10 @@ TIOCM_RI see TIOCM_RNG
|
|||
TIOCM_DSR DSR (data set ready)
|
||||
.TE
|
||||
.TP
|
||||
.BI "TIOCMIWAIT int " arg
|
||||
.B TIOCMIWAIT
|
||||
Argument:
|
||||
.BI "int " arg
|
||||
.IP
|
||||
Wait for any of the 4 modem bits (DCD, RI, DSR, CTS) to change.
|
||||
The bits of interest are specified as a bit mask in
|
||||
.IR arg ,
|
||||
|
@ -475,7 +592,10 @@ The caller should use
|
|||
.B TIOCGICOUNT
|
||||
to see which bit has changed.
|
||||
.TP
|
||||
.BI "TIOCGICOUNT struct serial_icounter_struct *" argp
|
||||
.B TIOCGICOUNT
|
||||
Argument:
|
||||
.BI "struct serial_icounter_struct *" argp
|
||||
.IP
|
||||
Get counts of input serial line interrupts (DCD, RI, DSR, CTS).
|
||||
The counts are written to the
|
||||
.I serial_icounter_struct
|
||||
|
@ -486,13 +606,19 @@ Note: both 1->0 and 0->1 transitions are counted, except for
|
|||
RI, where only 0->1 transitions are counted.
|
||||
.SS Marking a line as local
|
||||
.TP
|
||||
.BI "TIOCGSOFTCAR int *" argp
|
||||
.B TIOCGSOFTCAR
|
||||
Argument:
|
||||
.BI "int *" argp
|
||||
.IP
|
||||
("Get software carrier flag")
|
||||
Get the status of the CLOCAL flag in the c_cflag field of the
|
||||
.I termios
|
||||
structure.
|
||||
.TP
|
||||
.BI "TIOCSSOFTCAR const int *" argp
|
||||
.B TIOCSSOFTCAR
|
||||
Argument:
|
||||
.BI "const int *" argp
|
||||
.IP
|
||||
("Set software carrier flag")
|
||||
Set the CLOCAL flag in the
|
||||
.I termios
|
||||
|
@ -522,7 +648,10 @@ ioctl, see
|
|||
.SS Kernel debugging
|
||||
.B "#include <linux/tty.h>"
|
||||
.TP
|
||||
.BI "TIOCTTYGSTRUCT struct tty_struct *" argp
|
||||
.B TIOCTTYGSTRUCT
|
||||
Argument:
|
||||
.BI "struct tty_struct *" argp
|
||||
.IP
|
||||
Get the
|
||||
.I tty_struct
|
||||
corresponding to
|
||||
|
|
Loading…
Reference in New Issue