Mercurial > gnulib
annotate lib/termios.in.h @ 40057:b06060465f09
maint: Run 'make update-copyright'
author | Paul Eggert <eggert@cs.ucla.edu> |
---|---|
date | Tue, 01 Jan 2019 00:25:11 +0100 |
parents | 10eb9086bea0 |
children |
rev | line source |
---|---|
13687 | 1 /* Substitute for and wrapper around <termios.h>. |
40057
b06060465f09
maint: Run 'make update-copyright'
Paul Eggert <eggert@cs.ucla.edu>
parents:
19484
diff
changeset
|
2 Copyright (C) 2010-2019 Free Software Foundation, Inc. |
13687 | 3 |
4 This program is free software; you can redistribute it and/or modify | |
5 it under the terms of the GNU General Public License as published by | |
6 the Free Software Foundation; either version 2, or (at your option) | |
7 any later version. | |
8 | |
9 This program 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 | |
12 GNU General Public License for more details. | |
13 | |
14 You should have received a copy of the GNU General Public License | |
19190 | 15 along with this program; if not, see <https://www.gnu.org/licenses/>. */ |
13687 | 16 |
14840
5f709022a256
Allow multiple gnulib generated include files to be combined.
Bruno Haible <bruno@clisp.org>
parents:
14083
diff
changeset
|
17 #ifndef _@GUARD_PREFIX@_TERMIOS_H |
13687 | 18 |
19 #if __GNUC__ >= 3 | |
20 @PRAGMA_SYSTEM_HEADER@ | |
21 #endif | |
13761
a19ace3ba849
Avoid line length limitation from HP NonStop system header files.
Bruno Haible <bruno@clisp.org>
parents:
13689
diff
changeset
|
22 @PRAGMA_COLUMNS@ |
13687 | 23 |
14083
5c5416c2942e
tcgetsid: Correct linkage in C++ mode on HP-UX 11.00.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
24 /* On HP-UX 11.00, some of the function declarations in <sys/termio.h>, |
5c5416c2942e
tcgetsid: Correct linkage in C++ mode on HP-UX 11.00.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
25 included by <termios.h>, are not protected by extern "C". Enforce |
5c5416c2942e
tcgetsid: Correct linkage in C++ mode on HP-UX 11.00.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
26 "C" linkage for these functions nevertheless. */ |
5c5416c2942e
tcgetsid: Correct linkage in C++ mode on HP-UX 11.00.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
27 #if defined __hpux && defined __cplusplus |
5c5416c2942e
tcgetsid: Correct linkage in C++ mode on HP-UX 11.00.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
28 # include <sys/types.h> |
5c5416c2942e
tcgetsid: Correct linkage in C++ mode on HP-UX 11.00.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
29 # include <sys/ioctl.h> |
5c5416c2942e
tcgetsid: Correct linkage in C++ mode on HP-UX 11.00.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
30 extern "C" { |
5c5416c2942e
tcgetsid: Correct linkage in C++ mode on HP-UX 11.00.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
31 # include <sys/termio.h> |
5c5416c2942e
tcgetsid: Correct linkage in C++ mode on HP-UX 11.00.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
32 } |
5c5416c2942e
tcgetsid: Correct linkage in C++ mode on HP-UX 11.00.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
33 #endif |
5c5416c2942e
tcgetsid: Correct linkage in C++ mode on HP-UX 11.00.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
34 |
13687 | 35 /* The include_next requires a split double-inclusion guard. */ |
13801
634db78ff254
termios: fix compilation on mingw
Eric Blake <eblake@redhat.com>
parents:
13761
diff
changeset
|
36 #if @HAVE_TERMIOS_H@ |
634db78ff254
termios: fix compilation on mingw
Eric Blake <eblake@redhat.com>
parents:
13761
diff
changeset
|
37 # @INCLUDE_NEXT@ @NEXT_TERMIOS_H@ |
634db78ff254
termios: fix compilation on mingw
Eric Blake <eblake@redhat.com>
parents:
13761
diff
changeset
|
38 #endif |
13687 | 39 |
14840
5f709022a256
Allow multiple gnulib generated include files to be combined.
Bruno Haible <bruno@clisp.org>
parents:
14083
diff
changeset
|
40 #ifndef _@GUARD_PREFIX@_TERMIOS_H |
5f709022a256
Allow multiple gnulib generated include files to be combined.
Bruno Haible <bruno@clisp.org>
parents:
14083
diff
changeset
|
41 #define _@GUARD_PREFIX@_TERMIOS_H |
13687 | 42 |
13689 | 43 /* Get pid_t. */ |
16522
982859eb1700
termios: fix pid_t always, not just for tcgetsid
Eric Blake <eblake@redhat.com>
parents:
16517
diff
changeset
|
44 #include <sys/types.h> |
13689 | 45 |
46 /* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ | |
47 | |
48 /* The definition of _GL_WARN_ON_USE is copied here. */ | |
49 | |
13687 | 50 |
51 /* Declare overridden functions. */ | |
52 | |
13689 | 53 #if @GNULIB_TCGETSID@ |
54 /* Return the session ID of the controlling terminal of the current process. | |
55 The argument is a descriptor if this controlling terminal. | |
56 Return -1, with errno set, upon failure. errno = ENOSYS means that the | |
57 function is unsupported. */ | |
13955
7f79090fda41
tcgetsid: Add missing declaration on OSF/1 5.1.
Bruno Haible <bruno@clisp.org>
parents:
13801
diff
changeset
|
58 # if !@HAVE_DECL_TCGETSID@ |
13689 | 59 _GL_FUNCDECL_SYS (tcgetsid, pid_t, (int fd)); |
60 # endif | |
61 _GL_CXXALIAS_SYS (tcgetsid, pid_t, (int fd)); | |
62 _GL_CXXALIASWARN (tcgetsid); | |
63 #elif defined GNULIB_POSIXCHECK | |
64 # undef tcgetsid | |
65 # if HAVE_RAW_DECL_TCGETSID | |
66 _GL_WARN_ON_USE (tcgetsid, "tcgetsid is not portable - " | |
67 "use gnulib module tcgetsid for portability"); | |
68 # endif | |
69 #endif | |
70 | |
71 | |
14840
5f709022a256
Allow multiple gnulib generated include files to be combined.
Bruno Haible <bruno@clisp.org>
parents:
14083
diff
changeset
|
72 #endif /* _@GUARD_PREFIX@_TERMIOS_H */ |
5f709022a256
Allow multiple gnulib generated include files to be combined.
Bruno Haible <bruno@clisp.org>
parents:
14083
diff
changeset
|
73 #endif /* _@GUARD_PREFIX@_TERMIOS_H */ |