diff options
Diffstat (limited to 'man/man2const')
52 files changed, 1394 insertions, 0 deletions
diff --git a/man/man2const/FIONREAD.2const b/man/man2const/FIONREAD.2const new file mode 100644 index 0000000000..5806d280ed --- /dev/null +++ b/man/man2const/FIONREAD.2const @@ -0,0 +1,77 @@ +.\" 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 FIONREAD 2const (date) "Linux man-pages (unreleased)" +.SH NAME +FIONREAD, +TIOCINQ, +TIOCOUTQ, +TCFLSH, +TIOCSERGETLSR +\- +buffer count and flushing +.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 ", FIONREAD, int *" argp ); +.BI "int ioctl(int " fd ", TIOCINQ, int *" argp ); +.BI "int ioctl(int " fd ", TIOCOUTQ, int *" argp ); +.BI "int ioctl(int " fd ", TCFLSH, int " arg ); +.BI "int ioctl(int " fd ", FIONREAD, int *" argp ); +.fi +.SH DESCRIPTION +.TP +.B FIONREAD +Get the number of bytes in the input buffer. +.TP +.B TIOCINQ +Same as +.BR FIONREAD . +.TP +.B TIOCOUTQ +Get the number of bytes in the output buffer. +.TP +.B TCFLSH +Equivalent to +.IR "tcflush(fd, arg)" . +.IP +See +.BR tcflush (3) +for the argument values +.BR TCIFLUSH , +.BR TCOFLUSH , +.BR TCIOFLUSH . +.TP +.B TIOCSERGETLSR +Get line status register. +Status register has +.B TIOCSER_TEMT +bit set when +output buffer is empty and also hardware transmitter is physically empty. +.IP +Does not have to be supported by all serial tty drivers. +.IP +.BR tcdrain (3) +does not wait and returns immediately when +.B TIOCSER_TEMT +bit is set. +.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 ioctl_tty (2), +.BR tcflush (3), +.BR termios (3) diff --git a/man/man2const/TCFLSH.2const b/man/man2const/TCFLSH.2const new file mode 100644 index 0000000000..4e4569d543 --- /dev/null +++ b/man/man2const/TCFLSH.2const @@ -0,0 +1 @@ +.so man2const/FIONREAD.2const diff --git a/man/man2const/TCGETA.2const b/man/man2const/TCGETA.2const new file mode 100644 index 0000000000..e08469ef30 --- /dev/null +++ b/man/man2const/TCGETA.2const @@ -0,0 +1 @@ +.so man2const/TCSETS.2const diff --git a/man/man2const/TCGETS.2const b/man/man2const/TCGETS.2const new file mode 100644 index 0000000000..e08469ef30 --- /dev/null +++ b/man/man2const/TCGETS.2const @@ -0,0 +1 @@ +.so man2const/TCSETS.2const diff --git a/man/man2const/TCGETS2.2const b/man/man2const/TCGETS2.2const new file mode 100644 index 0000000000..e08469ef30 --- /dev/null +++ b/man/man2const/TCGETS2.2const @@ -0,0 +1 @@ +.so man2const/TCSETS.2const diff --git a/man/man2const/TCSBRK.2const b/man/man2const/TCSBRK.2const new file mode 100644 index 0000000000..f6ecba4cc1 --- /dev/null +++ b/man/man2const/TCSBRK.2const @@ -0,0 +1,85 @@ +.\" 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 TCSBRK 2const (date) "Linux man-pages (unreleased)" +.SH NAME +TCSBRK, +TCSBRKP, +TIOCSBRK, +TIOCCBRK +\- +sending a break +.SH LIBRARY +Standard C library +.RI ( libc ", " \-lc ) +.SH SYNOPSIS +.nf +.BR "#include <asm/termbits.h>" " /* Definition of " T*BRK* " constants */" +.B #include <sys/ioctl.h> +.P +.BI "int ioctl(int " fd ", TCSBRK, int " arg ); +.BI "int ioctl(int " fd ", TCSBRKP, int " arg ); +.BI "int ioctl(int " fd ", TIOCSBRK);" +.BI "int ioctl(int " fd ", TIOCCBRK);" +.fi +.SH DESCRIPTION +.TP +.B TCSBRK +Equivalent to +.IR "tcsendbreak(fd, arg)" . +.IP +If the terminal is using asynchronous serial data transmission, and +.I arg +is zero, then send a break (a stream of zero bits) for between +0.25 and 0.5 seconds. +If the terminal is not using asynchronous +serial data transmission, then either a break is sent, or the function +returns without doing anything. +When +.I arg +is nonzero, nobody knows what will happen. +.IP +(SVr4, UnixWare, Solaris, and Linux treat +.I "tcsendbreak(fd,arg)" +with nonzero +.I arg +like +.IR "tcdrain(fd)" . +SunOS treats +.I arg +as a multiplier, and sends a stream of bits +.I arg +times as long as done for zero +.IR arg . +DG/UX and AIX treat +.I arg +(when nonzero) as a time interval measured in milliseconds. +HP-UX ignores +.IR arg .) +.TP +.B TCSBRKP +So-called "POSIX version" of +.BR TCSBRK . +It treats nonzero +.I arg +as a time interval measured in deciseconds, and does nothing +when the driver does not support breaks. +.TP +.B TIOCSBRK +Turn break on, that is, start sending zero bits. +.TP +.B TIOCCBRK +Turn break off, that is, stop sending zero bits. +.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 ioctl_tty (2) diff --git a/man/man2const/TCSBRKP.2const b/man/man2const/TCSBRKP.2const new file mode 100644 index 0000000000..bbc8b79c62 --- /dev/null +++ b/man/man2const/TCSBRKP.2const @@ -0,0 +1 @@ +.so man2const/TCSBRK.2const diff --git a/man/man2const/TCSETA.2const b/man/man2const/TCSETA.2const new file mode 100644 index 0000000000..e08469ef30 --- /dev/null +++ b/man/man2const/TCSETA.2const @@ -0,0 +1 @@ +.so man2const/TCSETS.2const diff --git a/man/man2const/TCSETAF.2const b/man/man2const/TCSETAF.2const new file mode 100644 index 0000000000..e08469ef30 --- /dev/null +++ b/man/man2const/TCSETAF.2const @@ -0,0 +1 @@ +.so man2const/TCSETS.2const diff --git a/man/man2const/TCSETAW.2const b/man/man2const/TCSETAW.2const new file mode 100644 index 0000000000..e08469ef30 --- /dev/null +++ b/man/man2const/TCSETAW.2const @@ -0,0 +1 @@ +.so man2const/TCSETS.2const diff --git a/man/man2const/TCSETS.2const b/man/man2const/TCSETS.2const new file mode 100644 index 0000000000..f1e4d1d6d9 --- /dev/null +++ b/man/man2const/TCSETS.2const @@ -0,0 +1,268 @@ +.\" 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 TCSETS 2const (date) "Linux man-pages (unreleased)" +.SH NAME +TCGETS, +TCSETS, +TCSETSW, +TCSETSF, +TCGETS2, +TCSETS2, +TCSETSW2, +TCSETSF2, +TCGETA, +TCSETA, +TCSETAW, +TCSETAF +\- +get and set terminal attributes +.SH LIBRARY +Standard C library +.RI ( libc ", " \-lc ) +.SH SYNOPSIS +.nf +.BR "#include <asm/termbits.h>" " /* Definition of " TC* " constants */" +.B #include <sys/ioctl.h> +.P +.BI "int ioctl(int " fd ", TCGETS, struct termios *" argp ); +.BI "int ioctl(int " fd ", TCSETS, const struct termios *" argp ); +.BI "int ioctl(int " fd ", TCSETSW, const struct termios *" argp ); +.BI "int ioctl(int " fd ", TCSETSF, const struct termios *" argp ); +.P +.BI "int ioctl(int " fd ", TCGETS2, struct termios2 *" argp ); +.BI "int ioctl(int " fd ", TCSETS2, const struct termios2 *" argp ); +.BI "int ioctl(int " fd ", TCSETSW2, const struct termios2 *" argp ); +.BI "int ioctl(int " fd ", TCSETSF2, const struct termios2 *" argp ); +.P +.BI "int ioctl(int " fd ", TCGETA, struct termio *" argp ); +.BI "int ioctl(int " fd ", TCSETA, const struct termio *" argp ); +.BI "int ioctl(int " fd ", TCSETAW, const struct termio *" argp ); +.BI "int ioctl(int " fd ", TCSETAF, const struct termio *" argp ); +.P +.B #include <asm/termbits.h> +.P +.B struct termios; +.B struct termios2; +.B struct termio; +.fi +.SH DESCRIPTION +.TP +.B TCGETS +Equivalent to +.IR "tcgetattr(fd, argp)" . +.IP +Get the current serial port settings. +.TP +.B TCSETS +Equivalent to +.IR "tcsetattr(fd, TCSANOW, argp)" . +.IP +Set the current serial port settings. +.TP +.B TCSETSW +Equivalent to +.IR "tcsetattr(fd, TCSADRAIN, argp)" . +.IP +Allow the output buffer to drain, and +set the current serial port settings. +.TP +.B TCSETSF +Equivalent to +.IR "tcsetattr(fd, TCSAFLUSH, argp)" . +.IP +Allow the output buffer to drain, discard pending input, and +set the current serial port settings. +.P +The following four ioctls +are just like +.BR TCGETS , +.BR TCSETS , +.BR TCSETSW , +.BR TCSETSF , +except that they take a +.I "struct termios2\~*" +instead of a +.IR "struct termios\~*" . +If the structure member +.B c_cflag +contains the flag +.BR BOTHER , +then the baud rate is stored in the structure members +.B c_ispeed +and +.B c_ospeed +as integer values. +These ioctls are not supported on all architectures. +.RS +.TP +.B TCGETS2 +.TQ +.B TCSETS2 +.TQ +.B TCSETSW2 +.TQ +.B TCSETSF2 +.RE +.P +The following four ioctls are just like +.BR TCGETS , +.BR TCSETS , +.BR TCSETSW , +.BR TCSETSF , +except that they take a +.I "struct termio\~*" +instead of a +.IR "struct termios\~*" . +.RS +.TP +.B TCGETA +.TQ +.B TCSETA +.TQ +.B TCSETAW +.TQ +.B TCSETAF +.RE +.SH RETURN VALUE +On success, +0 is returned. +On error, \-1 is returned and +.I errno +is set to indicate the error. +.SH ERRORS +.TP +.B EPERM +Insufficient permission. +.SH HISTORY +.TP +.B TCGETS2 +.TQ +.B TCSETS2 +.TQ +.B TCSETSW2 +.TQ +.B TCSETSF2 +.\" linux.git commit 64bb6c5e1ddcd47c951740485026ef08975ee2e6 +.\" linux.git commit 592ee3a5e5e2a981ef2829a0380093006d045661 +Linux 2.6.20. +.SH CAVEATS +.B struct termios +from +.I <asm/termbits.h> +is different and incompatible with +.B struct termios +from +.IR <termios.h> . +These ioctl calls require +.B struct termios +from +.IR <asm/termbits.h> . +.SH EXAMPLES +Get or set arbitrary baudrate on the serial port. +.P +.\" SRC BEGIN (tcgets.c) +.EX +/* SPDX-License-Identifier: GPL-2.0-or-later */ +\& +#include <asm/termbits.h> +#include <fcntl.h> +#include <stdio.h> +#include <stdlib.h> +#include <sys/ioctl.h> +#include <unistd.h> +\& +int +main(int argc, char *argv[]) +{ +#if !defined BOTHER + fprintf(stderr, "BOTHER is unsupported\en"); + /* Program may fallback to TCGETS/TCSETS with Bnnn constants */ + exit(EXIT_FAILURE); +#else + /* Declare tio structure, its type depends on supported ioctl */ +# if defined TCGETS2 + struct termios2 tio; +# else + struct termios tio; +# endif + int fd, rc; +\& + if (argc != 2 && argc != 3 && argc != 4) { + fprintf(stderr, "Usage: %s device [output [input] ]\en", argv[0]); + exit(EXIT_FAILURE); + } +\& + fd = open(argv[1], O_RDWR | O_NONBLOCK | O_NOCTTY); + if (fd < 0) { + perror("open"); + exit(EXIT_FAILURE); + } +\& + /* Get the current serial port settings via supported ioctl */ +# if defined TCGETS2 + rc = ioctl(fd, TCGETS2, &tio); +# else + rc = ioctl(fd, TCGETS, &tio); +# endif + if (rc) { + perror("TCGETS"); + close(fd); + exit(EXIT_FAILURE); + } +\& + /* Change baud rate when more arguments were provided */ + if (argc == 3 || argc == 4) { + /* Clear the current output baud rate and fill a new value */ + tio.c_cflag &= \[ti]CBAUD; + tio.c_cflag |= BOTHER; + tio.c_ospeed = atoi(argv[2]); +\& + /* Clear the current input baud rate and fill a new value */ + tio.c_cflag &= \[ti](CBAUD << IBSHIFT); + tio.c_cflag |= BOTHER << IBSHIFT; + /* When 4th argument is not provided reuse output baud rate */ + tio.c_ispeed = (argc == 4) ? atoi(argv[3]) : atoi(argv[2]); +\& + /* Set new serial port settings via supported ioctl */ +# if defined TCSETS2 + rc = ioctl(fd, TCSETS2, &tio); +# else + rc = ioctl(fd, TCSETS, &tio); +# endif + if (rc) { + perror("TCSETS"); + close(fd); + exit(EXIT_FAILURE); + } +\& + /* And get new values which were really configured */ +# if defined TCGETS2 + rc = ioctl(fd, TCGETS2, &tio); +# else + rc = ioctl(fd, TCGETS, &tio); +# endif + if (rc) { + perror("TCGETS"); + close(fd); + exit(EXIT_FAILURE); + } + } +\& + close(fd); +\& + printf("output baud rate: %u\en", tio.c_ospeed); + printf("input baud rate: %u\en", tio.c_ispeed); +\& + exit(EXIT_SUCCESS); +#endif +} +.EE +.\" SRC END +.SH SEE ALSO +.BR ioctl (2), +.BR ioctl_tty (2), +.BR termios (3) diff --git a/man/man2const/TCSETS2.2const b/man/man2const/TCSETS2.2const new file mode 100644 index 0000000000..e08469ef30 --- /dev/null +++ b/man/man2const/TCSETS2.2const @@ -0,0 +1 @@ +.so man2const/TCSETS.2const diff --git a/man/man2const/TCSETSF.2const b/man/man2const/TCSETSF.2const new file mode 100644 index 0000000000..e08469ef30 --- /dev/null +++ b/man/man2const/TCSETSF.2const @@ -0,0 +1 @@ +.so man2const/TCSETS.2const diff --git a/man/man2const/TCSETSF2.2const b/man/man2const/TCSETSF2.2const new file mode 100644 index 0000000000..e08469ef30 --- /dev/null +++ b/man/man2const/TCSETSF2.2const @@ -0,0 +1 @@ +.so man2const/TCSETS.2const diff --git a/man/man2const/TCSETSW.2const b/man/man2const/TCSETSW.2const new file mode 100644 index 0000000000..e08469ef30 --- /dev/null +++ b/man/man2const/TCSETSW.2const @@ -0,0 +1 @@ +.so man2const/TCSETS.2const diff --git a/man/man2const/TCSETSW2.2const b/man/man2const/TCSETSW2.2const new file mode 100644 index 0000000000..e08469ef30 --- /dev/null +++ b/man/man2const/TCSETSW2.2const @@ -0,0 +1 @@ +.so man2const/TCSETS.2const diff --git a/man/man2const/TCXONC.2const b/man/man2const/TCXONC.2const new file mode 100644 index 0000000000..71ae7b0fe2 --- /dev/null +++ b/man/man2const/TCXONC.2const @@ -0,0 +1,44 @@ +.\" 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 TCXONC 2const (date) "Linux man-pages (unreleased)" +.SH NAME +TCXONC +\- +software flow control +.SH LIBRARY +Standard C library +.RI ( libc ", " \-lc ) +.SH SYNOPSIS +.nf +.BR "#include <asm/termbits.h>" " /* Definition of " TCXONC " */" +.B #include <sys/ioctl.h> +.P +.BI "int ioctl(int " fd ", TCXONC, int " arg ); +.fi +.SH DESCRIPTION +Equivalent to +.IR "tcflow(fd, arg)" . +.P +See +.BR tcflow (3) +for the argument values +.BR TCOOFF , +.BR TCOON , +.BR TCIOFF , +.BR TCION . +.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 ioctl_tty (2), +.BR tcflow (3), +.BR termios (3) diff --git a/man/man2const/TIOCCBRK.2const b/man/man2const/TIOCCBRK.2const new file mode 100644 index 0000000000..bbc8b79c62 --- /dev/null +++ b/man/man2const/TIOCCBRK.2const @@ -0,0 +1 @@ +.so man2const/TCSBRK.2const diff --git a/man/man2const/TIOCCONS.2const b/man/man2const/TIOCCONS.2const new file mode 100644 index 0000000000..49de5c6aa5 --- /dev/null +++ b/man/man2const/TIOCCONS.2const @@ -0,0 +1,64 @@ +.\" 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 TIOCCONS 2const (date) "Linux man-pages (unreleased)" +.SH NAME +TIOCCONS +\- +redirecting console output +.SH LIBRARY +Standard C library +.RI ( libc ", " \-lc ) +.SH SYNOPSIS +.nf +.BR "#include <asm/termbits.h>" " /* Definition of " TIOCCONS " */" +.B #include <sys/ioctl.h> +.P +.BI "int ioctl(int " fd ", TIOCCONS);" +.fi +.SH DESCRIPTION +Redirect output that would have gone to +.I /dev/console +or +.I /dev/tty0 +to the given terminal. +If that was a pseudoterminal master, send it to the slave. +.P +Only a process with the +.B CAP_SYS_ADMIN +capability may do this. +.P +If output was redirected already, then +.B EBUSY +is returned, +but redirection can be stopped by using this ioctl with +.I fd +pointing at +.I /dev/console +or +.IR /dev/tty0 . +.SH RETURN VALUE +On success, +0 is returned. +On error, +\-1 is returned, and +.I errno +is set to indicate the error. +.SH ERRORS +.TP +.B EBUSY +Output was redirected already. +.TP +.B EPERM +Insufficient permission. +.SH HISTORY +Before Linux 2.6.10, +anybody can do this as long as the output was not redirected yet; +.B CAP_SYS_ADMIN +was not necessary. +.SH SEE ALSO +.BR ioctl (2), +.BR ioctl_tty (2) diff --git a/man/man2const/TIOCEXCL.2const b/man/man2const/TIOCEXCL.2const new file mode 100644 index 0000000000..e55a72b4bd --- /dev/null +++ b/man/man2const/TIOCEXCL.2const @@ -0,0 +1,61 @@ +.\" 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 TIOCEXCL 2const (date) "Linux man-pages (unreleased)" +.SH NAME +TIOCEXCL, +TIOCGEXCL, +TIOCNXCL +\- +exclusive mode +.SH LIBRARY +Standard C library +.RI ( libc ", " \-lc ) +.SH SYNOPSIS +.nf +.BR "#include <asm/termbits.h>" " /* Definition of " TIOC*XCL " constants */" +.B #include <sys/ioctl.h> +.P +.BI "int ioctl(int " fd ", TIOCEXCL);" +.BI "int ioctl(int " fd ", TIOCGEXCL, int *" argp ); +.BI "int ioctl(int " fd ", TIOCNXCL);" +.fi +.SH DESCRIPTION +.TP +.B TIOCEXCL +Put the terminal into exclusive mode. +No further +.BR open (2) +operations on the terminal are permitted. +(They fail with +.BR EBUSY , +except for a process with the +.B CAP_SYS_ADMIN +capability.) +.TP +.B TIOCGEXCL +If the terminal is currently in exclusive mode, +place a nonzero value in the location pointed to by +.IR argp ; +otherwise, place zero in +.IR *argp . +.TP +.B TIOCNXCL +Disable exclusive mode. +.SH RETURN VALUE +On success, +0 is returned. +On error, +\-1 is returned, and +.I errno +is set to indicate the error. +.SH HISTORY +.TP +.B TIOCGEXCL +Linux 3.8. +.SH SEE ALSO +.BR ioctl (2), +.BR ioctl_tty (2) diff --git a/man/man2const/TIOCGETD.2const b/man/man2const/TIOCGETD.2const new file mode 100644 index 0000000000..d725c6da35 --- /dev/null +++ b/man/man2const/TIOCGETD.2const @@ -0,0 +1 @@ +.so man2const/TIOCSETD.2const diff --git a/man/man2const/TIOCGEXCL.2const b/man/man2const/TIOCGEXCL.2const new file mode 100644 index 0000000000..6902235010 --- /dev/null +++ b/man/man2const/TIOCGEXCL.2const @@ -0,0 +1 @@ +.so man2const/TIOCEXCL.2const diff --git a/man/man2const/TIOCGICOUNT.2const b/man/man2const/TIOCGICOUNT.2const new file mode 100644 index 0000000000..deacd3a02e --- /dev/null +++ b/man/man2const/TIOCGICOUNT.2const @@ -0,0 +1 @@ +.so man2const/TIOCMSET.2const diff --git a/man/man2const/TIOCGLCKTRMIOS.2const b/man/man2const/TIOCGLCKTRMIOS.2const new file mode 100644 index 0000000000..fba08431e6 --- /dev/null +++ b/man/man2const/TIOCGLCKTRMIOS.2const @@ -0,0 +1 @@ +.so man2const/TIOCSLCKTRMIOS.2const diff --git a/man/man2const/TIOCGPGRP.2const b/man/man2const/TIOCGPGRP.2const new file mode 100644 index 0000000000..edd9a9d20d --- /dev/null +++ b/man/man2const/TIOCGPGRP.2const @@ -0,0 +1 @@ +.so man2const/TIOCSPGRP.2const diff --git a/man/man2const/TIOCGPKT.2const b/man/man2const/TIOCGPKT.2const new file mode 100644 index 0000000000..f4897b7a92 --- /dev/null +++ b/man/man2const/TIOCGPKT.2const @@ -0,0 +1 @@ +.so man2const/TIOCPKT.2const diff --git a/man/man2const/TIOCGPTLCK.2const b/man/man2const/TIOCGPTLCK.2const new file mode 100644 index 0000000000..f4897b7a92 --- /dev/null +++ b/man/man2const/TIOCGPTLCK.2const @@ -0,0 +1 @@ +.so man2const/TIOCPKT.2const diff --git a/man/man2const/TIOCGPTPEER.2const b/man/man2const/TIOCGPTPEER.2const new file mode 100644 index 0000000000..f4897b7a92 --- /dev/null +++ b/man/man2const/TIOCGPTPEER.2const @@ -0,0 +1 @@ +.so man2const/TIOCPKT.2const diff --git a/man/man2const/TIOCGSID.2const b/man/man2const/TIOCGSID.2const new file mode 100644 index 0000000000..edd9a9d20d --- /dev/null +++ b/man/man2const/TIOCGSID.2const @@ -0,0 +1 @@ +.so man2const/TIOCSPGRP.2const diff --git a/man/man2const/TIOCGSOFTCAR.2const b/man/man2const/TIOCGSOFTCAR.2const new file mode 100644 index 0000000000..f58f8fe9f2 --- /dev/null +++ b/man/man2const/TIOCGSOFTCAR.2const @@ -0,0 +1 @@ +.so man2const/TIOCSSOFTCAR.2const diff --git a/man/man2const/TIOCGWINSZ.2const b/man/man2const/TIOCGWINSZ.2const new file mode 100644 index 0000000000..76e53625ad --- /dev/null +++ b/man/man2const/TIOCGWINSZ.2const @@ -0,0 +1 @@ +.so man2const/TIOCSWINSZ.2const diff --git a/man/man2const/TIOCINQ.2const b/man/man2const/TIOCINQ.2const new file mode 100644 index 0000000000..4e4569d543 --- /dev/null +++ b/man/man2const/TIOCINQ.2const @@ -0,0 +1 @@ +.so man2const/FIONREAD.2const diff --git a/man/man2const/TIOCMBIC.2const b/man/man2const/TIOCMBIC.2const new file mode 100644 index 0000000000..deacd3a02e --- /dev/null +++ b/man/man2const/TIOCMBIC.2const @@ -0,0 +1 @@ +.so man2const/TIOCMSET.2const diff --git a/man/man2const/TIOCMBIS.2const b/man/man2const/TIOCMBIS.2const new file mode 100644 index 0000000000..deacd3a02e --- /dev/null +++ b/man/man2const/TIOCMBIS.2const @@ -0,0 +1 @@ +.so man2const/TIOCMSET.2const diff --git a/man/man2const/TIOCMGET.2const b/man/man2const/TIOCMGET.2const new file mode 100644 index 0000000000..deacd3a02e --- /dev/null +++ b/man/man2const/TIOCMGET.2const @@ -0,0 +1 @@ +.so man2const/TIOCMSET.2const diff --git a/man/man2const/TIOCMIWAIT.2const b/man/man2const/TIOCMIWAIT.2const new file mode 100644 index 0000000000..deacd3a02e --- /dev/null +++ b/man/man2const/TIOCMIWAIT.2const @@ -0,0 +1 @@ +.so man2const/TIOCMSET.2const diff --git a/man/man2const/TIOCMSET.2const b/man/man2const/TIOCMSET.2const new file mode 100644 index 0000000000..34dd0ae254 --- /dev/null +++ b/man/man2const/TIOCMSET.2const @@ -0,0 +1,125 @@ +'\" t +.\" 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 TIOCMSET 2const (date) "Linux man-pages (unreleased)" +.SH NAME +TIOCMGET, +TIOCMSET, +TIOCMBIC, +TIOCMBIS, +TIOCMIWAIT, +TIOCGICOUNT +\- +modem control +.SH LIBRARY +Standard C library +.RI ( libc ", " \-lc ) +.SH SYNOPSIS +.nf +.BR "#include <asm/termbits.h>" " /* Definition of " TIOC* " constants */" +.B #include <sys/ioctl.h> +.P +.BI "int ioctl(int " fd ", TIOCMGET, int *" argp ); +.BI "int ioctl(int " fd ", TIOCMSET, const int *" argp ); +.BI "int ioctl(int " fd ", TIOCMBIC, const int *" argp ); +.BI "int ioctl(int " fd ", TIOCMBIS, const int *" argp ); +.BI "int ioctl(int " fd ", TIOCMIWAIT, int " arg ); +.BI "int ioctl(int " fd ", TIOCGICOUNT, struct serial_icounter_struct *" argp ); +.P +.B #include <linux/serial.h> +.P +.B struct serial_icounter_struct; +.fi +.SH DESCRIPTION +.TP +.B TIOCMGET +Get the status of modem bits. +.TP +.B TIOCMSET +Set the status of modem bits. +.TP +.B TIOCMBIC +Clear the indicated modem bits. +.TP +.B TIOCMBIS +Set the indicated modem bits. +.P +The following bits are used by the above ioctls: +.P +.TS +lb l. +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) +.TE +.TP +.B TIOCMIWAIT +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 , +by ORing together any of the bit values, +.BR TIOCM_RNG , +.BR TIOCM_DSR , +.BR TIOCM_CD , +and +.BR TIOCM_CTS . +The caller should use +.B TIOCGICOUNT +to see which bit has changed. +.TP +.B TIOCGICOUNT +Get counts of input serial line interrupts (DCD, RI, DSR, CTS). +The counts are written to the +.I serial_icounter_struct +structure pointed to by +.IR argp . +.IP +Note: both 1->0 and 0->1 transitions are counted, except for +RI, where only 0->1 transitions are counted. +.SH RETURN VALUE +On success, +0 is returned. +On error, +\-1 is returned, and +.I errno +is set to indicate the error. +.SH EXAMPLES +Check the condition of DTR on the serial port. +.P +.\" SRC BEGIN (tiocmget.c) +.EX +#include <fcntl.h> +#include <stdio.h> +#include <sys/ioctl.h> +#include <unistd.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 set"); + else + puts("TIOCM_DTR is not set"); + close(fd); +} +.EE +.\" SRC END +.SH SEE ALSO +.BR ioctl (2), +.BR ioctl_tty (2) diff --git a/man/man2const/TIOCNOTTY.2const b/man/man2const/TIOCNOTTY.2const new file mode 100644 index 0000000000..8e959d33aa --- /dev/null +++ b/man/man2const/TIOCNOTTY.2const @@ -0,0 +1 @@ +.so man2const/TIOCSCTTY.2const diff --git a/man/man2const/TIOCNXCL.2const b/man/man2const/TIOCNXCL.2const new file mode 100644 index 0000000000..6902235010 --- /dev/null +++ b/man/man2const/TIOCNXCL.2const @@ -0,0 +1 @@ +.so man2const/TIOCEXCL.2const diff --git a/man/man2const/TIOCOUTQ.2const b/man/man2const/TIOCOUTQ.2const new file mode 100644 index 0000000000..4e4569d543 --- /dev/null +++ b/man/man2const/TIOCOUTQ.2const @@ -0,0 +1 @@ +.so man2const/FIONREAD.2const diff --git a/man/man2const/TIOCPKT.2const b/man/man2const/TIOCPKT.2const new file mode 100644 index 0000000000..528200fdd6 --- /dev/null +++ b/man/man2const/TIOCPKT.2const @@ -0,0 +1,165 @@ +'\" t +.\" 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 TIOCPKT 2const (date) "Linux man-pages (unreleased)" +.SH NAME +TIOCPKT, +TIOCGPKT, +TIOCSPTLCK, +TIOCGPTLCK, +TIOCGPTPEER +\- +pseudoterminal ioctls +.SH LIBRARY +Standard C library +.RI ( libc ", " \-lc ) +.SH SYNOPSIS +.nf +.BR "#include <asm/termbits.h>" " /* Definition of " TIOC* " constants */" +.B #include <sys/ioctl.h> +.P +.BI "int ioctl(int " fd ", TIOCPKT, const int *" mode ); +.BI "int ioctl(int " fd ", TIOCPKT, int *" mode ); +.P +.BI "int ioctl(int " fd ", TIOCSPTLCK, const int *" lock ); +.BI "int ioctl(int " fd ", TIOCGPTLCK, int *" lock ); +.P +.BI "int ioctl(int " fd ", TIOCGPTPEER, int " flags ); +.fi +.SH DESCRIPTION +.TP +.B TIOCPKT +Enable (when +.RI * mode +is nonzero) or disable packet mode. +Can be applied to the master side of a pseudoterminal only (and will return +.B ENOTTY +otherwise). +In packet mode, each subsequent +.BR read (2) +will return a packet that either contains a single nonzero control byte, +or has a single byte containing zero (\[aq]\e0\[aq]) followed by data +written on the slave side of the pseudoterminal. +If the first byte is not +.B TIOCPKT_DATA +(0), it is an OR of one +or more of the following bits: +.IP +.ad l +.TS +lb l. +TIOCPKT_FLUSHREAD T{ +The read queue for the terminal is flushed. +T} +TIOCPKT_FLUSHWRITE T{ +The write queue for the terminal is flushed. +T} +TIOCPKT_STOP T{ +Output to the terminal is stopped. +T} +TIOCPKT_START T{ +Output to the terminal is restarted. +T} +TIOCPKT_DOSTOP T{ +The start and stop characters are \fB\[ha]S\fP/\fB\[ha]Q\fP. +T} +TIOCPKT_NOSTOP T{ +The start and stop characters are not \fB\[ha]S\fP/\fB\[ha]Q\fP. +T} +.TE +.ad +.IP +While packet mode is in use, the presence +of control status information to be read +from the master side may be detected by a +.BR select (2) +for exceptional conditions or a +.BR poll (2) +for the +.B POLLPRI +event. +.IP +This mode is used by +.BR rlogin (1) +and +.BR rlogind (8) +to implement a remote-echoed, +locally \fB\[ha]S\fP/\fB\[ha]Q\fP flow-controlled remote login. +.TP +.B TIOCGPKT +Return the current packet mode setting in the integer pointed to by +.IR mode . +.TP +.B TIOCSPTLCK +Set (if +.I *lock +is nonzero) or remove (if +.I *lock +is zero) the lock on the pseudoterminal slave device. +(See also +.BR unlockpt (3).) +.TP +.B TIOCGPTLCK +Place the current lock state of the pseudoterminal slave device +in the location pointed to by +.IR lock . +.TP +.B TIOCGPTPEER +Given a file descriptor in +.I fd +that refers to a pseudoterminal master, +open (with the given +.BR open (2)-style +.IR flags ) +and return a new file descriptor that refers to the peer +pseudoterminal slave device. +This operation can be performed +regardless of whether the pathname of the slave device +is accessible through the calling process's mount namespace. +.IP +Security-conscious programs interacting with namespaces may wish to use this +operation rather than +.BR open (2) +with the pathname returned by +.BR ptsname (3), +and similar library functions that have insecure APIs. +(For example, confusion can occur in some cases using +.BR ptsname (3) +with a pathname where a devpts filesystem +has been mounted in a different mount namespace.) +.SH RETURN VALUE +On success, +0 is returned. +On error, +\-1 is returned, and +.I errno +is set to indicate the error. +.SH ERRORS +.TP +.B ENOTTY +.SH HISTORY +.TP +.B TIOCGPKT +Linux 3.8. +.TP +.B TIOCGPTLCK +Linux 3.8. +.TP +.B TIOCGPTPEER +.\" linux.git commit 54ebbfb1603415d9953c150535850d30609ef077 +Linux 4.13. +.P +The BSD ioctls +.BR TIOCSTOP , +.BR TIOCSTART , +.BR TIOCUCNTL , +and +.B TIOCREMOTE +have not been implemented under Linux. +.SH SEE ALSO +.BR ioctl (2), +.BR ioctl_tty (2) diff --git a/man/man2const/TIOCSBRK.2const b/man/man2const/TIOCSBRK.2const new file mode 100644 index 0000000000..bbc8b79c62 --- /dev/null +++ b/man/man2const/TIOCSBRK.2const @@ -0,0 +1 @@ +.so man2const/TCSBRK.2const diff --git a/man/man2const/TIOCSCTTY.2const b/man/man2const/TIOCSCTTY.2const new file mode 100644 index 0000000000..0858656095 --- /dev/null +++ b/man/man2const/TIOCSCTTY.2const @@ -0,0 +1,67 @@ +.\" 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 TIOCSCTTY 2const (date) "Linux man-pages (unreleased)" +.SH NAME +TIOCSCTTY, +TIOCNOTTY +\- +controlling the terminal +.SH LIBRARY +Standard C library +.RI ( libc ", " \-lc ) +.SH SYNOPSIS +.nf +.BR "#include <asm/termbits.h>" " /* Definition of " TIOC*TTY " constants */" +.B #include <sys/ioctl.h> +.P +.BI "int ioctl(int " fd ", TIOCSCTTY, int " arg ); +.BI "int ioctl(int " fd ", TIOCNOTTY);" +.fi +.SH DESCRIPTION +.TP +.B TIOCSCTTY +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. +For this case, +.I arg +should be specified as zero. +.IP +If this terminal is already the controlling terminal +of a different session group, then the ioctl fails with +.BR EPERM , +unless the caller has the +.B CAP_SYS_ADMIN +capability and +.I arg +equals 1, in which case the terminal is stolen, and all processes that had +it as controlling terminal lose it. +.TP +.B TIOCNOTTY +If the given terminal was the controlling terminal of the calling process, +give up this controlling terminal. +If the process was session leader, +then send +.B SIGHUP +and +.B SIGCONT +to the foreground process group +and all processes in the current session lose their controlling terminal. +.SH RETURN VALUE +On success, +0 is returned. +On error, +\-1 is returned, and +.I errno +is set to indicate the error. +.SH ERRORS +.TP +.B EPERM +Insufficient permission. +.SH SEE ALSO +.BR ioctl (2), +.BR ioctl_tty (2) diff --git a/man/man2const/TIOCSERGETLSR.2const b/man/man2const/TIOCSERGETLSR.2const new file mode 100644 index 0000000000..4e4569d543 --- /dev/null +++ b/man/man2const/TIOCSERGETLSR.2const @@ -0,0 +1 @@ +.so man2const/FIONREAD.2const diff --git a/man/man2const/TIOCSETD.2const b/man/man2const/TIOCSETD.2const new file mode 100644 index 0000000000..c024a0fe5f --- /dev/null +++ b/man/man2const/TIOCSETD.2const @@ -0,0 +1,40 @@ +.\" 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 TIOCSETD 2const (date) "Linux man-pages (unreleased)" +.SH NAME +TIOCGETD, +TIOCSETD +\- +get or set the line discipline of the terminal +.SH LIBRARY +Standard C library +.RI ( libc ", " \-lc ) +.SH SYNOPSIS +.nf +.BR "#include <asm/termbits.h>" " /* Definition of " TIOC*ETD " constants */" +.B #include <sys/ioctl.h> +.P +.BI "int ioctl(int " fd ", TIOCGETD, int *" argp ); +.BI "int ioctl(int " fd ", TIOCSETD, const int *" argp ); +.fi +.SH DESCRIPTION +.TP +.B TIOCGETD +Get the line discipline of the terminal. +.TP +.B TIOCSETD +Set the line discipline of the terminal. +.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 ioctl_tty (2) diff --git a/man/man2const/TIOCSLCKTRMIOS.2const b/man/man2const/TIOCSLCKTRMIOS.2const new file mode 100644 index 0000000000..ae901371a1 --- /dev/null +++ b/man/man2const/TIOCSLCKTRMIOS.2const @@ -0,0 +1,76 @@ +.\" 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 TIOCSLCKTRMIOS 2const (date) "Linux man-pages (unreleased)" +.SH NAME +TIOCGLCKTRMIOS, +TIOCSLCKTRMIOS +\- +locking the termios structre +.SH LIBRARY +Standard C library +.RI ( libc ", " \-lc ) +.SH SYNOPSIS +.nf +.BR "#include <asm/termbits.h>" " /* Definition of " TIOC*CLKTRMIOS " constants */" +.B #include <sys/ioctl.h> +.P +.BI "int ioctl(int " fd ", TIOCGLCKTRMIOS, struct termios *" argp ); +.BI "int ioctl(int " fd ", TIOCSLCKTRMIOS, const struct termios *" argp ); +.P +.B #include <asm/termbits.h> +.P +.B struct termios; +.fi +.SH DESCRIPTION +The +.I termios +structure of a terminal can be locked. +The lock is itself a +.I termios +structure, with nonzero bits or fields indicating a +locked value. +.TP +.B TIOCGLCKTRMIOS +Gets the locking status of the +.I termios +structure of the terminal. +.TP +.B TIOCSLCKTRMIOS +Sets the locking status of the +.I termios +structure of the terminal. +Only a process with the +.B CAP_SYS_ADMIN +capability can do this. +.SH RETURN VALUE +On success, +0 is returned. +On error, +\-1 is returned, and +.I errno +is set to indicate the error. +.SH ERRORS +.TP +.B EPERM +Insufficient permission. +.SH CAVEATS +Please note that +.B struct termios +from +.I <asm/termbits.h> +is different and incompatible with +.B struct termios +from +.IR <termios.h> . +These ioctl calls require +.B struct termios +from +.IR <asm/termbits.h> . +.SH SEE ALSO +.BR ioctl (2), +.BR ioctl_tty (2), +.BR TCSETS (2const) diff --git a/man/man2const/TIOCSPGRP.2const b/man/man2const/TIOCSPGRP.2const new file mode 100644 index 0000000000..32dc89c343 --- /dev/null +++ b/man/man2const/TIOCSPGRP.2const @@ -0,0 +1,69 @@ +.\" 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 TIOCSPGRP 2const (date) "Linux man-pages (unreleased)" +.SH NAME +TIOCGPGRP, +TIOCSPGRP, +TIOCGSID +\- +process group and session ID +.SH LIBRARY +Standard C library +.RI ( libc ", " \-lc ) +.SH SYNOPSIS +.nf +.BR "#include <asm/termbits.h>" " /* Definition of " TIOC* " constants */" +.B #include <sys/ioctl.h> +.P +.BI "int ioctl(int " fd ", TIOCGPGRP, pid_t *" argp ); +.BI "int ioctl(int " fd ", TIOCSPGRP, const pid_t *" argp ); +.BI "int ioctl(int " fd ", TIOCGSID, pid_t *" argp ); +.fi +.SH DESCRIPTION +.TP +.B TIOCGPGRP +When successful, equivalent to +.IR "*argp = tcgetpgrp(fd)" . +.IP +Get the process group ID of the foreground process group on this terminal. +.TP +.B TIOCSPGRP +Equivalent to +.IR "tcsetpgrp(fd, *argp)" . +.IP +Set the foreground process group ID of this terminal. +.TP +.B TIOCGSID +When successful, equivalent to +.IR "*argp = tcgetsid(fd)" . +.IP +Get the session ID of the given terminal. +This fails with the error +.B ENOTTY +if the terminal is not a master pseudoterminal +and not our controlling terminal. +Strange. +.SH RETURN VALUE +On success, +0 is returned. +On error, +\-1 is returned, and +.I errno +is set to indicate the error. +.SH ERRORS +.TP +.B ENOTTY +The terminal is not a master pseudoterminal and not our controlling terminal. +.TP +.B EPERM +Insufficient permission. +.SH SEE ALSO +.BR ioctl (2), +.BR ioctl_tty (2), +.BR tcgetpgrp (3), +.BR tcsetpgrp (3), +.BR tcgetsid (3) diff --git a/man/man2const/TIOCSPTLCK.2const b/man/man2const/TIOCSPTLCK.2const new file mode 100644 index 0000000000..f4897b7a92 --- /dev/null +++ b/man/man2const/TIOCSPTLCK.2const @@ -0,0 +1 @@ +.so man2const/TIOCPKT.2const diff --git a/man/man2const/TIOCSSOFTCAR.2const b/man/man2const/TIOCSSOFTCAR.2const new file mode 100644 index 0000000000..722cf334c3 --- /dev/null +++ b/man/man2const/TIOCSSOFTCAR.2const @@ -0,0 +1,63 @@ +.\" 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 TIOCSSOFTCAR 2const (date) "Linux man-pages (unreleased)" +.SH NAME +TIOCGSOFTCAR, +TIOCSSOFTCAR +\- +marking a line as local +.SH LIBRARY +Standard C library +.RI ( libc ", " \-lc ) +.SH SYNOPSIS +.nf +.BR "#include <asm/termbits.h>" " /* Definition of " TIOC*SOFTCAR " constants */" +.B #include <sys/ioctl.h> +.P +.BI "int ioctl(int " fd ", TIOCGSOFTCAR, int *" argp ); +.BI "int ioctl(int " fd ", TIOCSSOFTCAR, const int *" argp ); +.fi +.SH DESCRIPTION +.TP +.B TIOCGSOFTCAR +("Get software carrier flag") +Get the status of the CLOCAL flag in the c_cflag field of the +.I termios +structure. +.TP +.B TIOCSSOFTCAR +("Set software carrier flag") +Set the CLOCAL flag in the +.I termios +structure when +.RI * argp +is nonzero, and clear it otherwise. +.P +If the +.B CLOCAL +flag for a line is off, the hardware carrier detect (DCD) +signal is significant, and an +.BR open (2) +of the corresponding terminal will block until DCD is asserted, +unless the +.B O_NONBLOCK +flag is given. +If +.B 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. +.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 ioctl_tty (2) diff --git a/man/man2const/TIOCSTI.2const b/man/man2const/TIOCSTI.2const new file mode 100644 index 0000000000..e105e25ee3 --- /dev/null +++ b/man/man2const/TIOCSTI.2const @@ -0,0 +1,46 @@ +.\" 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 TIOCSTI 2const (date) "Linux man-pages (unreleased)" +.SH NAME +TIOCSTI +\- +faking input +.SH LIBRARY +Standard C library +.RI ( libc ", " \-lc ) +.SH SYNOPSIS +.nf +.BR "#include <asm/termbits.h>" " /* Definition of " TIOCSTI " */" +.B #include <sys/ioctl.h> +.P +.BI "int ioctl(int " fd ", TIOCSTI, const char *" argp ); +.fi +.SH DESCRIPTION +Insert the given byte in the input queue. +.P +Since Linux 6.2, +.\" linux.git commit 690c8b804ad2eafbd35da5d3c95ad325ca7d5061 +.\" linux.git commit 83efeeeb3d04b22aaed1df99bc70a48fe9d22c4d +this operation may require the +.B CAP_SYS_ADMIN +capability (if the +.I dev.tty.legacy_tiocsti +sysctl variable is set to false). +.SH RETURN VALUE +On success, +0 is returned. +On error, +\-1 is returned, and +.I errno +is set to indicate the error. +.SH ERRORS +.TP +.B EPERM +Insufficient permission. +.SH SEE ALSO +.BR ioctl (2), +.BR ioctl_tty (2) diff --git a/man/man2const/TIOCSWINSZ.2const b/man/man2const/TIOCSWINSZ.2const new file mode 100644 index 0000000000..1633625e2e --- /dev/null +++ b/man/man2const/TIOCSWINSZ.2const @@ -0,0 +1,58 @@ +.\" 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 TIOCSWINSZ 2const (date) "Linux man-pages (unreleased)" +.SH NAME +TIOCGWINSZ, +TIOCSWINSZ +\- +get and set window size +.SH LIBRARY +Standard C library +.RI ( libc ", " \-lc ) +.SH SYNOPSIS +.nf +.BR "#include <asm/termbits.h>" " /* Definition of " TIOC*WINSZ " constants */" +.B #include <sys/ioctl.h> +.P +.BI "int ioctl(int " fd ", TIOCGWINSZ, struct winsize *" argp ); +.BI "int ioctl(int " fd ", TIOCSWINSZ, const struct winsize *" argp ); +.P +.B #include <asm/termios.h> +.P +.B struct winsize { +.B " unsigned short ws_row;" +.B " unsigned short ws_col;" +.BR " unsigned short ws_xpixel;" " /* unused */" +.BR " unsigned short ws_ypixel;" " /* unused */" +.B }; +.fi +.SH DESCRIPTION +Window sizes are kept in the kernel, but not used by the kernel +(except in the case of virtual consoles, where the kernel will +update the window size when the size of the virtual console changes, +for example, by loading a new font). +.TP +.B TIOCGWINSZ +Get window size. +.TP +.B TIOCSWINSZ +Set window size. +.P +When the window size changes, a +.B SIGWINCH +signal is sent to the +foreground process group. +.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 ioctl_tty (2const) diff --git a/man/man2const/TIOCTTYGSTRUCT.2const b/man/man2const/TIOCTTYGSTRUCT.2const new file mode 100644 index 0000000000..15b16d49a2 --- /dev/null +++ b/man/man2const/TIOCTTYGSTRUCT.2const @@ -0,0 +1,50 @@ +.\" 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 TIOCTTYGSTRUCT 2const (date) "Linux man-pages (unreleased)" +.SH NAME +TIOCTTYGSTRUCT +\- +kernel debugging +.SH LIBRARY +Standard C library +.RI ( libc ", " \-lc ) +.SH SYNOPSIS +.nf +.B #include <sys/ioctl.h> +.P +.BI "int ioctl(int " fd ", TIOCTTYGSTRUCT, struct tty_struct *" argp ); +.P +.B #include <linux/tty.h> +.P +.B struct tty_struct; +.fi +.SH DESCRIPTION +Get the +.I tty_struct +corresponding to +.IR fd . +.SH RETURN VALUE +On success, +0 is returned. +On error, +\-1 is returned, and +.I errno +is set to indicate the error. +.SH HISTORY +This operation was removed in Linux 2.5.67. +.\" commit b3506a09d15dc5aee6d4bb88d759b157016e1864 +.\" Author: Andries E. Brouwer <andries.brouwer@cwi.nl> +.\" Date: Tue Apr 1 04:42:46 2003 -0800 +.\" +.\" [PATCH] kill TIOCTTYGSTRUCT +.\" +.\" Only used for (dubious) debugging purposes, and exposes +.\" internal kernel state. +.\" +.SH SEE ALSO +.BR ioctl (2), +.BR ioctl_tty (2) |
