1 /* Copyright (C) 1991-1994,1996-1999,2003,2010,2012
2 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library; if not, see
17 <http://www.gnu.org/licenses/>. */
20 * POSIX Standard: 7.1-2 General Terminal Interface <termios.h>
27 #if defined __USE_UNIX98 || defined __USE_XOPEN2K8
28 /* We need `pid_t'. */
29 # include <bits/types.h>
30 # ifndef __pid_t_defined
31 typedef __pid_t pid_t
;
32 # define __pid_t_defined
38 /* Get the system-dependent definitions of `struct termios', `tcflag_t',
39 `cc_t', `speed_t', and all the macros specifying the flag bits. */
40 #include <bits/termios.h>
43 /* Compare a character C to a value VAL from the `c_cc' array in a
44 `struct termios'. If VAL is _POSIX_VDISABLE, no character can match it. */
45 # define CCEQ(val, c) ((c) == (val) && (val) != _POSIX_VDISABLE)
48 /* Return the output baud rate stored in *TERMIOS_P. */
49 extern speed_t
cfgetospeed (const struct termios
*__termios_p
) __THROW
;
51 /* Return the input baud rate stored in *TERMIOS_P. */
52 extern speed_t
cfgetispeed (const struct termios
*__termios_p
) __THROW
;
54 /* Set the output baud rate stored in *TERMIOS_P to SPEED. */
55 extern int cfsetospeed (struct termios
*__termios_p
, speed_t __speed
) __THROW
;
57 /* Set the input baud rate stored in *TERMIOS_P to SPEED. */
58 extern int cfsetispeed (struct termios
*__termios_p
, speed_t __speed
) __THROW
;
61 /* Set both the input and output baud rates in *TERMIOS_OP to SPEED. */
62 extern int cfsetspeed (struct termios
*__termios_p
, speed_t __speed
) __THROW
;
66 /* Put the state of FD into *TERMIOS_P. */
67 extern int tcgetattr (int __fd
, struct termios
*__termios_p
) __THROW
;
69 /* Set the state of FD to *TERMIOS_P.
70 Values for OPTIONAL_ACTIONS (TCSA*) are in <bits/termios.h>. */
71 extern int tcsetattr (int __fd
, int __optional_actions
,
72 const struct termios
*__termios_p
) __THROW
;
76 /* Set *TERMIOS_P to indicate raw mode. */
77 extern void cfmakeraw (struct termios
*__termios_p
) __THROW
;
80 /* Send zero bits on FD. */
81 extern int tcsendbreak (int __fd
, int __duration
) __THROW
;
83 /* Wait for pending output to be written on FD.
85 This function is a cancellation point and therefore not marked with
87 extern int tcdrain (int __fd
);
89 /* Flush pending data on FD.
90 Values for QUEUE_SELECTOR (TC{I,O,IO}FLUSH) are in <bits/termios.h>. */
91 extern int tcflush (int __fd
, int __queue_selector
) __THROW
;
93 /* Suspend or restart transmission on FD.
94 Values for ACTION (TC[IO]{OFF,ON}) are in <bits/termios.h>. */
95 extern int tcflow (int __fd
, int __action
) __THROW
;
98 #if defined __USE_UNIX98 || defined __USE_XOPEN2K8
99 /* Get process group ID for session leader for controlling terminal FD. */
100 extern __pid_t
tcgetsid (int __fd
) __THROW
;
105 # include <sys/ttydefaults.h>
110 #endif /* termios.h */