tcsetattrfd
tcsetattrfd is a non-POSIX extension of the terminal attribute interface. It mirrors the general purpose idea of tcsetattr but is implemented as an auxiliary function on some systems to operate on a file descriptor that is tied to a controlling terminal. Because it is not part of the POSIX standard, its availability and exact semantics vary by platform and library implementation.
The typical prototype is similar to the standard tcsetattr:
int tcsetattrfd(int fd, int optional_actions, const struct termios *termios_p);
- fd: a file descriptor associated with a terminal for which the attributes will be set.
- optional_actions: one of the same values used by tcsetattr (for example, TCSANOW, TCSADRAIN, TCSAFLUSH) determining when
- termios_p: a pointer to a termios structure containing the desired terminal attributes.
On success, tcsetattrfd returns 0. On error, -1 is returned and errno is set to indicate the
Because tcsetattrfd is not part of the standard C or POSIX APIs, code that uses it is
tcgetattr, tcsetattr, termios, TCSANOW, TCSADRAIN, TCSAFLUSH.