Skip to main content

Module termios

Module termios 

Source
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_speed, Termios::set_input_speed, and Termios::set_output_speed, and they will simply fail if the speed is not supported by the platform or the device.

Modules§

speedNeither target_os=espidf nor WASI
Speeds for use with Termios::set_speed, Termios::set_input_speed, and Termios::set_output_speed.

Structs§

ControlModesNeither target_os=espidf nor WASI
Flags controlling special terminal modes.
InputModesNeither target_os=espidf nor WASI
Flags controlling terminal input.
LocalModesNeither target_os=espidf nor WASI
Flags controlling “local” terminal modes.
OutputModesNeither target_os=espidf nor WASI
Flags controlling terminal output.
Pid
pid_t—A non-zero Unix process ID.
SpecialCodeIndexNeither target_os=espidf nor WASI
Indices for use with Termios::special_codes.
SpecialCodesNeither target_os=espidf nor WASI
An array indexed by SpecialCodeIndex indicating the current values of various special control codes.
TermiosNeither target_os=espidf nor WASI
struct termios for use with tcgetattr and tcsetattr.
WinsizeNeither target_os=espidf nor WASI
struct winsize for use with tcgetwinsize.

Enums§

ActionNeither target_os=espidf nor WASI
TC* values for use with tcflow.
OptionalActionsNeither target_os=espidf nor WASI
TCSA* values for use with tcsetattr.
QueueSelectorNeither target_os=espidf nor WASI
TC* values for use with tcflush.

Functions§

ioctl_tiocexclNeither Cygwin nor target_os=espidf nor Haiku nor WASI and neither Windows nor target_os=horizon nor Redox nor WASI
ioctl(fd, TIOCEXCL)—Enables exclusive mode on a terminal.
ioctl_tiocnxclNeither Cygwin nor target_os=espidf nor Haiku nor WASI and neither Windows nor target_os=horizon nor Redox nor WASI
ioctl(fd, TIOCNXCL)—Disables exclusive mode on a terminal.
isattyNon-Windows
isatty(fd)—Tests whether a file descriptor refers to a terminal.
tcdrainNon-WASI and non-target_os=espidf
tcdrain(fd, duration)—Wait until all pending output has been written.
tcflowNon-WASI and non-target_os=espidf
tcflow(fd, action)—Suspend or resume transmission or reception.
tcflushNon-WASI and non-target_os=espidf
tcflush(fd, queue_selector)—Wait until all pending output has been written.
tcgetattrNon-WASI and neither Windows nor target_os=espidf nor WASI
tcgetattr(fd)—Get terminal attributes.
tcgetpgrpNon-WASI and neither Windows nor WASI
tcgetpgrp(fd)—Get the terminal foreground process group.
tcgetsidNon-WASI
tcgetsid(fd)—Return the session ID of the current session with fd as its controlling terminal.
tcgetwinsizeNon-WASI and neither Windows nor target_os=horizon nor target_os=espidf nor WASI
tcgetwinsize(fd)—Get the current terminal window size.
tcsendbreakNon-WASI
tcsendbreak(fd, 0)—Transmit zero-valued bits.
tcsetattrNon-WASI and non-target_os=espidf
tcsetattr(fd)—Set terminal attributes.
tcsetpgrpNon-WASI and neither Windows nor WASI
tcsetpgrp(fd, pid)—Set the terminal foreground process group.
tcsetwinsizeNon-WASI and neither target_os=espidf nor target_os=horizon
tcsetwinsize(fd)—Set the current terminal window size.
ttynamefs and alloc
ttyname_r(fd)—Returns the name of the tty open on fd.