When setting terminal attributes via tcsetattr(fd.....), can fd be either stdout or stdin? <p>I have been looking int the <a href="http://linux.die.net/man/3/tcgetattr" rel="nofollow">man 3 tcgetattr</a> (as I want to change the terminal settings in a program) and found this.</p> <pre><code>int tcgetattr(int fd, struct termios *termios_p); int tcsetattr(int fd, int optional_actions, const struct termios *termios_p); </code></pre> <h1>Question:</h1> <p>I would like to know what <code>fd</code> should mean? (it seems to be <code>stdin</code>, yet I do not understand why)?</p> <h1>Background</h1> <p>My comprehension is that terminal is input and output together, as my understanding was that a <code>/dev/tty</code> or <code>/dev/pty</code> yields <code>stdin</code>, <code>stdout</code> and <code>stderr</code> together. </p>