]> git.ipfire.org Git - thirdparty/glibc.git/blame - termios/termios.h
tunables: report sbrk() failure
[thirdparty/glibc.git] / termios / termios.h
CommitLineData
04277e02 1/* Copyright (C) 1991-2019 Free Software Foundation, Inc.
b5791037
UD
2 This file is part of the GNU C Library.
3
4 The GNU C Library is free software; you can redistribute it and/or
41bdb6e2
AJ
5 modify it under the terms of the GNU Lesser General Public
6 License as published by the Free Software Foundation; either
7 version 2.1 of the License, or (at your option) any later version.
b5791037
UD
8
9 The GNU C Library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
41bdb6e2 12 Lesser General Public License for more details.
b5791037 13
41bdb6e2 14 You should have received a copy of the GNU Lesser General Public
59ba27a6 15 License along with the GNU C Library; if not, see
5a82c748 16 <https://www.gnu.org/licenses/>. */
28f540f4
RM
17
18/*
19 * POSIX Standard: 7.1-2 General Terminal Interface <termios.h>
20 */
21
22#ifndef _TERMIOS_H
28f540f4 23#define _TERMIOS_H 1
5107cf1d 24
28f540f4 25#include <features.h>
b7db7606 26#if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8
af6f3906
UD
27/* We need `pid_t'. */
28# include <bits/types.h>
7df789e0 29# ifndef __pid_t_defined
af6f3906 30typedef __pid_t pid_t;
7df789e0 31# define __pid_t_defined
af6f3906
UD
32# endif
33#endif
28f540f4
RM
34
35__BEGIN_DECLS
36
37/* Get the system-dependent definitions of `struct termios', `tcflag_t',
38 `cc_t', `speed_t', and all the macros specifying the flag bits. */
5107cf1d 39#include <bits/termios.h>
28f540f4 40
498afc54 41#ifdef __USE_MISC
28f540f4
RM
42/* Compare a character C to a value VAL from the `c_cc' array in a
43 `struct termios'. If VAL is _POSIX_VDISABLE, no character can match it. */
dfd2257a 44# define CCEQ(val, c) ((c) == (val) && (val) != _POSIX_VDISABLE)
28f540f4
RM
45#endif
46
47/* Return the output baud rate stored in *TERMIOS_P. */
a784e502 48extern speed_t cfgetospeed (const struct termios *__termios_p) __THROW;
28f540f4
RM
49
50/* Return the input baud rate stored in *TERMIOS_P. */
a784e502 51extern speed_t cfgetispeed (const struct termios *__termios_p) __THROW;
28f540f4
RM
52
53/* Set the output baud rate stored in *TERMIOS_P to SPEED. */
c1422e5b 54extern int cfsetospeed (struct termios *__termios_p, speed_t __speed) __THROW;
28f540f4
RM
55
56/* Set the input baud rate stored in *TERMIOS_P to SPEED. */
c1422e5b 57extern int cfsetispeed (struct termios *__termios_p, speed_t __speed) __THROW;
28f540f4 58
498afc54 59#ifdef __USE_MISC
28f540f4 60/* Set both the input and output baud rates in *TERMIOS_OP to SPEED. */
c1422e5b 61extern int cfsetspeed (struct termios *__termios_p, speed_t __speed) __THROW;
28f540f4
RM
62#endif
63
64
65/* Put the state of FD into *TERMIOS_P. */
c1422e5b 66extern int tcgetattr (int __fd, struct termios *__termios_p) __THROW;
28f540f4 67
28f540f4 68/* Set the state of FD to *TERMIOS_P.
5107cf1d 69 Values for OPTIONAL_ACTIONS (TCSA*) are in <bits/termios.h>. */
c1422e5b 70extern int tcsetattr (int __fd, int __optional_actions,
a784e502 71 const struct termios *__termios_p) __THROW;
28f540f4
RM
72
73
498afc54 74#ifdef __USE_MISC
28f540f4 75/* Set *TERMIOS_P to indicate raw mode. */
c1422e5b 76extern void cfmakeraw (struct termios *__termios_p) __THROW;
28f540f4
RM
77#endif
78
79/* Send zero bits on FD. */
c1422e5b 80extern int tcsendbreak (int __fd, int __duration) __THROW;
28f540f4 81
2c008571
UD
82/* Wait for pending output to be written on FD.
83
84 This function is a cancellation point and therefore not marked with
85 __THROW. */
86extern int tcdrain (int __fd);
28f540f4
RM
87
88/* Flush pending data on FD.
5107cf1d 89 Values for QUEUE_SELECTOR (TC{I,O,IO}FLUSH) are in <bits/termios.h>. */
c1422e5b 90extern int tcflush (int __fd, int __queue_selector) __THROW;
28f540f4
RM
91
92/* Suspend or restart transmission on FD.
5107cf1d 93 Values for ACTION (TC[IO]{OFF,ON}) are in <bits/termios.h>. */
c1422e5b 94extern int tcflow (int __fd, int __action) __THROW;
28f540f4
RM
95
96
b7db7606 97#if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8
af6f3906 98/* Get process group ID for session leader for controlling terminal FD. */
c1422e5b 99extern __pid_t tcgetsid (int __fd) __THROW;
af6f3906
UD
100#endif
101
102
498afc54 103#ifdef __USE_MISC
dfd2257a 104# include <sys/ttydefaults.h>
28f540f4
RM
105#endif
106
107__END_DECLS
108
109#endif /* termios.h */