Mercurial > hg > octave-shane > gnulib-hg
annotate lib/termios.in.h @ 14083:5c5416c2942e
tcgetsid: Correct linkage in C++ mode on HP-UX 11.00.
* lib/termios.in.h: In C++ mode, on HP-UX, include <sys/termios.h> with
C linkage.
* doc/posix-functions/tcgetsid.texi: Mention the HP-UX 11.00 bug.
author | Bruno Haible <bruno@clisp.org> |
---|---|
date | Sun, 02 Jan 2011 13:30:17 +0100 |
parents | 97fc9a21a8fb |
children | 5f709022a256 |
rev | line source |
---|---|
13687 | 1 /* Substitute for and wrapper around <termios.h>. |
14079
97fc9a21a8fb
maint: update almost all copyright ranges to include 2011
Jim Meyering <meyering@redhat.com>
parents:
13955
diff
changeset
|
2 Copyright (C) 2010-2011 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 | |
15 along with this program; if not, write to the Free Software Foundation, | |
16 Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ | |
17 | |
18 #ifndef _GL_TERMIOS_H | |
19 | |
20 #if __GNUC__ >= 3 | |
21 @PRAGMA_SYSTEM_HEADER@ | |
22 #endif | |
13761
a19ace3ba849
Avoid line length limitation from HP NonStop system header files.
Bruno Haible <bruno@clisp.org>
parents:
13689
diff
changeset
|
23 @PRAGMA_COLUMNS@ |
13687 | 24 |
14083
5c5416c2942e
tcgetsid: Correct linkage in C++ mode on HP-UX 11.00.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
25 /* 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
|
26 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
|
27 "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
|
28 #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
|
29 # 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
|
30 # 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
|
31 extern "C" { |
5c5416c2942e
tcgetsid: Correct linkage in C++ mode on HP-UX 11.00.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
32 # 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
|
33 } |
5c5416c2942e
tcgetsid: Correct linkage in C++ mode on HP-UX 11.00.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
34 #endif |
5c5416c2942e
tcgetsid: Correct linkage in C++ mode on HP-UX 11.00.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
35 |
13687 | 36 /* 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
|
37 #if @HAVE_TERMIOS_H@ |
634db78ff254
termios: fix compilation on mingw
Eric Blake <eblake@redhat.com>
parents:
13761
diff
changeset
|
38 # @INCLUDE_NEXT@ @NEXT_TERMIOS_H@ |
634db78ff254
termios: fix compilation on mingw
Eric Blake <eblake@redhat.com>
parents:
13761
diff
changeset
|
39 #endif |
13687 | 40 |
41 #ifndef _GL_TERMIOS_H | |
42 #define _GL_TERMIOS_H | |
43 | |
13689 | 44 #if @GNULIB_TCGETSID@ |
45 /* Get pid_t. */ | |
46 # include <sys/types.h> | |
47 #endif | |
48 | |
49 /* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ | |
50 | |
51 /* The definition of _GL_WARN_ON_USE is copied here. */ | |
52 | |
13687 | 53 |
54 /* Declare overridden functions. */ | |
55 | |
13689 | 56 #if @GNULIB_TCGETSID@ |
57 /* Return the session ID of the controlling terminal of the current process. | |
58 The argument is a descriptor if this controlling terminal. | |
59 Return -1, with errno set, upon failure. errno = ENOSYS means that the | |
60 function is unsupported. */ | |
13955
7f79090fda41
tcgetsid: Add missing declaration on OSF/1 5.1.
Bruno Haible <bruno@clisp.org>
parents:
13801
diff
changeset
|
61 # if !@HAVE_DECL_TCGETSID@ |
13689 | 62 _GL_FUNCDECL_SYS (tcgetsid, pid_t, (int fd)); |
63 # endif | |
64 _GL_CXXALIAS_SYS (tcgetsid, pid_t, (int fd)); | |
65 _GL_CXXALIASWARN (tcgetsid); | |
66 #elif defined GNULIB_POSIXCHECK | |
67 # undef tcgetsid | |
68 # if HAVE_RAW_DECL_TCGETSID | |
69 _GL_WARN_ON_USE (tcgetsid, "tcgetsid is not portable - " | |
70 "use gnulib module tcgetsid for portability"); | |
71 # endif | |
72 #endif | |
73 | |
74 | |
13687 | 75 #endif /* _GL_TERMIOS_H */ |
76 #endif /* _GL_TERMIOS_H */ |