Available on crate feature
termios
only.Expand description
Terminal I/O stream operations.
This API automatically supports setting arbitrary I/O speeds, on any platform that supports them, including Linux and the BSDs.
The speed
module contains various predefined speed constants which
are more likely to be portable, however any u32
value can be passed to
Termios::set_input_speed
, and it will simply fail if the speed is not
supported by the platform.
Modules§
- speed
- Speeds for use with
Termios::set_input_speed
andTermios::set_output_speed
.
Structs§
- Control
Modes - Flags controlling special terminal modes.
- Input
Modes - Flags controlling terminal input.
- Local
Modes - Flags controlling “local” terminal modes.
- Output
Modes - Flags controlling terminal output.
- Pid
pid_t
—A non-zero Unix process ID.- Special
Code Index - Indices for use with
Termios::special_codes
. - Special
Codes - An array indexed by
SpecialCodeIndex
indicating the current values of various special control codes. - Termios
struct termios
for use withtcgetattr
andtcsetattr
.
Enums§
- Action
TC*
values for use withtcflow
.- Optional
Actions TCSA*
values for use withtcsetattr
.- Queue
Selector TC*
values for use withtcflush
.
Functions§
- ioctl_
tiocexcl ioctl(fd, TIOCEXCL)
—Enables exclusive mode on a terminal.- ioctl_
tiocnxcl ioctl(fd, TIOCNXCL)
—Disables exclusive mode on a terminal.- isatty
isatty(fd)
—Tests whether a file descriptor refers to a terminal.- tcdrain
tcdrain(fd, duration)
—Wait until all pending output has been written.- tcflow
tcflow(fd, action)
—Suspend or resume transmission or reception.- tcflush
tcflush(fd, queue_selector)
—Wait until all pending output has been written.- tcgetattr
tcgetattr(fd)
—Get terminal attributes.- tcgetpgrp
tcgetpgrp(fd)
—Get the terminal foreground process group.- tcgetsid
tcgetsid(fd)
—Return the session ID of the current session withfd
as its controlling terminal.- tcgetwinsize
tcgetwinsize(fd)
—Get the current terminal window size.- tcsendbreak
tcsendbreak(fd, 0)
—Transmit zero-valued bits.- tcsetattr
tcsetattr(fd)
—Set terminal attributes.- tcsetpgrp
tcsetpgrp(fd, pid)
—Set the terminal foreground process group.- tcsetwinsize
tcsetwinsize(fd)
—Set the current terminal window size.
Type Aliases§
- Winsize
struct winsize
for use withtcgetwinsize
.