3 termios, tcgetattr, tcsetattr, cfgetispeed, cfgetospeed, cfsetispeed, cfsetospeed, tcsendbreak, tcdrain, tcflush, tcflow \- change terminal attributes
9 int tcgetattr(int \fIfd\fP, struct termios *\fItp\fP)
10 int tcsetattr(int \fIfd\fP, int \fIaction\fP, const struct termios *\fItp\fP)
12 speed_t cfgetispeed(const struct termios *\fItp\fP)
13 speed_t cfgetospeed(const struct termios *\fItp\fP)
14 int cfsetispeed(struct termios *\fItp\fP, speed_t \fIspeed\fP)
15 int cfsetospeed(struct termios *\fItp\fP, speed_t \fIspeed\fP)
17 int tcsendbreak(int \fIfd\fP, int \fIduration\fP)
18 int tcdrain(int \fIfd\fP)
19 int tcflush(int \fIfd\fP, int \fIqueue_selector\fP)
20 int tcflow(int \fIfd\fP, int \fIaction\fP)
28 These are the user functions that modify the tty attributes mentioned in
32 refers to an open terminal device file,
35 .BR "struct termios" ,
40 are equal to one of the
43 etc. baud rate symbols. All functions, symbols, and types are declared in
46 The effects of the tty functions are:
48 .B tcgetattr(\fIfd\fP, \fItp\fP)
49 Get the current settings of the tty attributes.
51 .B tcsetattr(\fIfd\fP, TCSANOW, \fItp\fP)
52 Set the terminal attributes. The change occurs immediately.
54 .B tcsetattr(\fIfd\fP, TCSADRAIN, \fItp\fP)
55 Set the terminal attributes. The change occurs once all the output waiting
56 in the output queues has been transmitted. This should be used when options
57 affecting output are changed.
59 .B tcsetattr(\fIfd\fP, TCSAFLUSH, \fItp\fP)
60 Set the terminal attributes. But first wait until all the output waiting
61 in the output queues has been transmitted. All input waiting in the input
62 queues is then discarded and the change is made. This should be used when
63 switching from canonical to non-canonical mode or vice-versa. (Oddly
64 enough, this is seldom what you want, because it discards typeahead. An
65 editing shell does the Right Thing if it uses
67 instead. \s-2POSIX\s+2 may not guarantee good results, but in practice most
68 systems make the canonical input available in raw mode.)
70 .B cfgetispeed(\fItp\fP)
71 Return the input baud rate encoded in the termios structure.
73 .B cfgetospeed(\fItp\fP)
74 Return the output baud rate encoded in the termios structure.
76 .B cfsetispeed(\fItp\fP, \fIspeed\fP)
77 Encode the new input baud rate into the termios structure.
79 .B cfsetospeed(\fItp\fP, \fIspeed\fP)
80 Encode the new output baud rate into the termios structure.
82 .B tcsendbreak(\fIfd\fP, \fIduration\fP)
83 Emit a break condition on a serial line for a time indicated by
85 (Always 0.4 seconds under MINIX 3,
90 Wait until all output waiting in the output queues has been transmitted.
92 .B tcflush(\fIfd\fP, TCIFLUSH)
93 Flush the input queue. (I.e. discard it.)
95 .B tcflush(\fIfd\fP, TCOFLUSH)
96 Flush the output queue.
98 .B tcflush(\fIfd\fP, TCIOFLUSH)
99 Flush the input and output queues.
101 .B tcflow(\fIfd\fP, TCOOFF)
102 Suspend output. (Like the effect of
105 .B tcflow(\fIfd\fP, TCOON)
106 Restart output. (Like the effect of
109 .B tcflow(\fIfd\fP, TCIOFF)
112 character intended to make the remote device stop transmitting data.
114 .B tcflow(\fIfd\fP, TCION)
117 character to restart the remote device.
122 All functions return 0 unless otherwise specified, and \-1 on error with
124 set to indicate the type of error. The most notable errors are
128 does not refer to a terminal device, and
130 if one of the functions waiting for output to drain is interrupted.
132 It may be interesting to know that the functions operating on the tty are
133 directly translated into the following MINIX 3
148 You should only use this knowledge when trying to understand the tty driver
152 Kees J. Bot (kjb@cs.vu.nl)
155 .\" $PchId: termios.3,v 1.2 1996/04/11 06:41:24 philip Exp $