TCSADRAIN
TCSADRAIN is a constant used with the tcsetattr function in POSIX-compliant systems to specify when terminal attribute changes should take effect. It is one of several optional_actions values defined for applying modifications to a terminal device as described in the termios interface.
With TCSADRAIN, the requested changes are applied after all output written to the terminal has been transmitted.
Other actions include TCSANOW, which applies changes immediately, and TCSAFLUSH, which applies changes after discarding any
In practice, a program obtains the current terminal settings with tcgetattr, modifies the desired fields in