When setting terminal attributes via tcsetattr(fd.....), can fd be either stdout or stdin?

Viewed 2149

I have been looking int the man 3 tcgetattr (as I want to change the terminal settings in a program) and found this.

int tcgetattr(int fd, struct termios *termios_p);

int tcsetattr(int fd, int optional_actions,
              const struct termios *termios_p);

Question:

I would like to know what fd should mean? (it seems to be stdin, yet I do not understand why)?

Background

My comprehension is that terminal is input and output together, as my understanding was that a /dev/tty or /dev/pty yields stdin, stdout and stderr together.

4 Answers
Related