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:
Michael Kerrisk 2021-01-06 23:46:06 +01:00
parent 6d1a711b69
commit 2858b5b5ef
1 changed files with 172 additions and 43 deletions

View File

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