pub fn tcsetattr(fd: RawFd, action: c_int, termios: &Termios) -> Result<()>
Sets a terminal device's parameters.
tcsetattr() returns successfully if it was able to perform any of the requested actions, even
if other requested actions could not be performed. It will set all attributes that the
implementation supports and leave others unchanged. The
Termios structure will not be updated
to reflect the changes that were applied.
In order to determine which parameters were applied to the terminal device, an application
tcgetattr() to obtain the latest state of the terminal
device. In particular, when attempting to change baud rates,
can be used to determine which baud rates were actually selected.
If none of the requested actions could be performed, then
tcsetattr() returns an error.
fdshould be an open file descriptor associated with a terminal.
actionshould be one of the constants:
TCSANOWapplies the change immediately.
TCSADRAINapplies the change after all output previously written to
fdis transmitted. This mode should be used when changing parameters that affect output.
TCSAFLUSHapplies the change after all output previously written to
fdis transmitted. All data received but not read is discarded before applying the change.
termiosshould be a mutable reference to a
Termiosstructure containing the parameters to apply to the terminal device.