annotate lib/sys_select.in.h @ 14079:97fc9a21a8fb

maint: update almost all copyright ranges to include 2011 Run the new "make update-copyright" rule.
author Jim Meyering <meyering@redhat.com>
date Sat, 01 Jan 2011 20:17:23 +0100
parents a9b8cdb01be3
children 0e87a6225f1a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
9265
6c8579ddc19d Rename sys_select_.h to sys_select.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1 /* Substitute for <sys/select.h>.
14079
97fc9a21a8fb maint: update almost all copyright ranges to include 2011
Jim Meyering <meyering@redhat.com>
parents: 14062
diff changeset
2 Copyright (C) 2007-2011 Free Software Foundation, Inc.
9265
6c8579ddc19d Rename sys_select_.h to sys_select.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
3
6c8579ddc19d Rename sys_select_.h to sys_select.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
4 This program is free software; you can redistribute it and/or modify
6c8579ddc19d Rename sys_select_.h to sys_select.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
5 it under the terms of the GNU General Public License as published by
6c8579ddc19d Rename sys_select_.h to sys_select.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
6 the Free Software Foundation; either version 2, or (at your option)
6c8579ddc19d Rename sys_select_.h to sys_select.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
7 any later version.
6c8579ddc19d Rename sys_select_.h to sys_select.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
8
6c8579ddc19d Rename sys_select_.h to sys_select.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
9 This program is distributed in the hope that it will be useful,
6c8579ddc19d Rename sys_select_.h to sys_select.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
6c8579ddc19d Rename sys_select_.h to sys_select.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
6c8579ddc19d Rename sys_select_.h to sys_select.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
12 GNU General Public License for more details.
6c8579ddc19d Rename sys_select_.h to sys_select.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
13
6c8579ddc19d Rename sys_select_.h to sys_select.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
14 You should have received a copy of the GNU General Public License
6c8579ddc19d Rename sys_select_.h to sys_select.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
15 along with this program; if not, write to the Free Software Foundation,
6c8579ddc19d Rename sys_select_.h to sys_select.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
16 Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
6c8579ddc19d Rename sys_select_.h to sys_select.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
17
10882
3c51cf16c4fa Fix compilation error on OSF/1 4.0.
Bruno Haible <bruno@clisp.org>
parents: 10655
diff changeset
18 # if __GNUC__ >= 3
3c51cf16c4fa Fix compilation error on OSF/1 4.0.
Bruno Haible <bruno@clisp.org>
parents: 10655
diff changeset
19 @PRAGMA_SYSTEM_HEADER@
3c51cf16c4fa Fix compilation error on OSF/1 4.0.
Bruno Haible <bruno@clisp.org>
parents: 10655
diff changeset
20 # endif
13761
a19ace3ba849 Avoid line length limitation from HP NonStop system header files.
Bruno Haible <bruno@clisp.org>
parents: 12944
diff changeset
21 @PRAGMA_COLUMNS@
10882
3c51cf16c4fa Fix compilation error on OSF/1 4.0.
Bruno Haible <bruno@clisp.org>
parents: 10655
diff changeset
22
3c51cf16c4fa Fix compilation error on OSF/1 4.0.
Bruno Haible <bruno@clisp.org>
parents: 10655
diff changeset
23 /* On OSF/1, <sys/types.h> and <sys/time.h> include <sys/select.h>.
3c51cf16c4fa Fix compilation error on OSF/1 4.0.
Bruno Haible <bruno@clisp.org>
parents: 10655
diff changeset
24 Simply delegate to the system's header in this case. */
3c51cf16c4fa Fix compilation error on OSF/1 4.0.
Bruno Haible <bruno@clisp.org>
parents: 10655
diff changeset
25 #if @HAVE_SYS_SELECT_H@ && defined __osf__ && (defined _SYS_TYPES_H_ && !defined _GL_SYS_SELECT_H_REDIRECT_FROM_SYS_TYPES_H) && defined _OSF_SOURCE
3c51cf16c4fa Fix compilation error on OSF/1 4.0.
Bruno Haible <bruno@clisp.org>
parents: 10655
diff changeset
26
3c51cf16c4fa Fix compilation error on OSF/1 4.0.
Bruno Haible <bruno@clisp.org>
parents: 10655
diff changeset
27 # define _GL_SYS_SELECT_H_REDIRECT_FROM_SYS_TYPES_H
3c51cf16c4fa Fix compilation error on OSF/1 4.0.
Bruno Haible <bruno@clisp.org>
parents: 10655
diff changeset
28 # @INCLUDE_NEXT@ @NEXT_SYS_SELECT_H@
3c51cf16c4fa Fix compilation error on OSF/1 4.0.
Bruno Haible <bruno@clisp.org>
parents: 10655
diff changeset
29
3c51cf16c4fa Fix compilation error on OSF/1 4.0.
Bruno Haible <bruno@clisp.org>
parents: 10655
diff changeset
30 #elif @HAVE_SYS_SELECT_H@ && defined __osf__ && (defined _SYS_TIME_H_ && !defined _GL_SYS_SELECT_H_REDIRECT_FROM_SYS_TIME_H) && defined _OSF_SOURCE
3c51cf16c4fa Fix compilation error on OSF/1 4.0.
Bruno Haible <bruno@clisp.org>
parents: 10655
diff changeset
31
3c51cf16c4fa Fix compilation error on OSF/1 4.0.
Bruno Haible <bruno@clisp.org>
parents: 10655
diff changeset
32 # define _GL_SYS_SELECT_H_REDIRECT_FROM_SYS_TIME_H
3c51cf16c4fa Fix compilation error on OSF/1 4.0.
Bruno Haible <bruno@clisp.org>
parents: 10655
diff changeset
33 # @INCLUDE_NEXT@ @NEXT_SYS_SELECT_H@
3c51cf16c4fa Fix compilation error on OSF/1 4.0.
Bruno Haible <bruno@clisp.org>
parents: 10655
diff changeset
34
3c51cf16c4fa Fix compilation error on OSF/1 4.0.
Bruno Haible <bruno@clisp.org>
parents: 10655
diff changeset
35 #else
3c51cf16c4fa Fix compilation error on OSF/1 4.0.
Bruno Haible <bruno@clisp.org>
parents: 10655
diff changeset
36
9265
6c8579ddc19d Rename sys_select_.h to sys_select.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
37 #ifndef _GL_SYS_SELECT_H
6c8579ddc19d Rename sys_select_.h to sys_select.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
38
6c8579ddc19d Rename sys_select_.h to sys_select.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
39 #if @HAVE_SYS_SELECT_H@
6c8579ddc19d Rename sys_select_.h to sys_select.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
40
6c8579ddc19d Rename sys_select_.h to sys_select.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
41 /* On many platforms, <sys/select.h> assumes prior inclusion of
6c8579ddc19d Rename sys_select_.h to sys_select.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
42 <sys/types.h>. */
6c8579ddc19d Rename sys_select_.h to sys_select.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
43 # include <sys/types.h>
6c8579ddc19d Rename sys_select_.h to sys_select.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
44
10541
142140ec3db8 strengthen self-containedness check for sys/select.h
Paolo Bonzini <bonzini@gnu.org>
parents: 10539
diff changeset
45 /* On OSF/1 4.0, <sys/select.h> provides only a forward declaration
12497
e2d59f164e76 Avoid future namespace pollution on glibc systems.
Bruno Haible <bruno@clisp.org>
parents: 11797
diff changeset
46 of 'struct timeval', and no definition of this type.
14011
68009ff4e161 sys_select: Ensure all necessary types on NonStop Kernel.
Bruno Haible <bruno@clisp.org>
parents: 14010
diff changeset
47 Also, MacOS X, AIX, HP-UX, IRIX, Solaris, Interix declare select()
68009ff4e161 sys_select: Ensure all necessary types on NonStop Kernel.
Bruno Haible <bruno@clisp.org>
parents: 14010
diff changeset
48 in <sys/time.h>.
12497
e2d59f164e76 Avoid future namespace pollution on glibc systems.
Bruno Haible <bruno@clisp.org>
parents: 11797
diff changeset
49 But avoid namespace pollution on glibc systems. */
e2d59f164e76 Avoid future namespace pollution on glibc systems.
Bruno Haible <bruno@clisp.org>
parents: 11797
diff changeset
50 # ifndef __GLIBC__
e2d59f164e76 Avoid future namespace pollution on glibc systems.
Bruno Haible <bruno@clisp.org>
parents: 11797
diff changeset
51 # include <sys/time.h>
e2d59f164e76 Avoid future namespace pollution on glibc systems.
Bruno Haible <bruno@clisp.org>
parents: 11797
diff changeset
52 # endif
10541
142140ec3db8 strengthen self-containedness check for sys/select.h
Paolo Bonzini <bonzini@gnu.org>
parents: 10539
diff changeset
53
11797
1bc3a28e8169 Make <sys/select.h> really self-contained, also on Solaris 10.
Bruno Haible <bruno@clisp.org>
parents: 11398
diff changeset
54 /* On Solaris 10, <sys/select.h> provides an FD_ZERO implementation
12497
e2d59f164e76 Avoid future namespace pollution on glibc systems.
Bruno Haible <bruno@clisp.org>
parents: 11797
diff changeset
55 that relies on memset(), but without including <string.h>.
13773
d06d8f66d2bd string, sys_select: Avoid #including large headers unless necessary.
Bruno Haible <bruno@clisp.org>
parents: 13761
diff changeset
56 But in any case avoid namespace pollution on glibc systems. */
13783
47adc262f2b7 sys_select: Avoid warning due to undeclared memset() on OpenBSD 4.5.
Bruno Haible <bruno@clisp.org>
parents: 13773
diff changeset
57 # if (defined __OpenBSD__ || defined __sun || defined __osf__ || defined __BEOS__) \
13773
d06d8f66d2bd string, sys_select: Avoid #including large headers unless necessary.
Bruno Haible <bruno@clisp.org>
parents: 13761
diff changeset
58 && ! defined __GLIBC__
12497
e2d59f164e76 Avoid future namespace pollution on glibc systems.
Bruno Haible <bruno@clisp.org>
parents: 11797
diff changeset
59 # include <string.h>
e2d59f164e76 Avoid future namespace pollution on glibc systems.
Bruno Haible <bruno@clisp.org>
parents: 11797
diff changeset
60 # endif
11797
1bc3a28e8169 Make <sys/select.h> really self-contained, also on Solaris 10.
Bruno Haible <bruno@clisp.org>
parents: 11398
diff changeset
61
9265
6c8579ddc19d Rename sys_select_.h to sys_select.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
62 /* The include_next requires a split double-inclusion guard. */
6c8579ddc19d Rename sys_select_.h to sys_select.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
63 # @INCLUDE_NEXT@ @NEXT_SYS_SELECT_H@
6c8579ddc19d Rename sys_select_.h to sys_select.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
64
6c8579ddc19d Rename sys_select_.h to sys_select.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
65 #endif
6c8579ddc19d Rename sys_select_.h to sys_select.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
66
6c8579ddc19d Rename sys_select_.h to sys_select.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
67 #ifndef _GL_SYS_SELECT_H
6c8579ddc19d Rename sys_select_.h to sys_select.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
68 #define _GL_SYS_SELECT_H
6c8579ddc19d Rename sys_select_.h to sys_select.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
69
14010
fd62a5de1a49 sys_select: Remove unneeded include.
Bruno Haible <bruno@clisp.org>
parents: 13783
diff changeset
70 #if !@HAVE_SYS_SELECT_H@
12944
e105c6e52c5d sys_select: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12875
diff changeset
71 /* A platform that lacks <sys/select.h>. */
14011
68009ff4e161 sys_select: Ensure all necessary types on NonStop Kernel.
Bruno Haible <bruno@clisp.org>
parents: 14010
diff changeset
72 /* Get the 'struct timeval' and 'fd_set' types and the FD_* macros
68009ff4e161 sys_select: Ensure all necessary types on NonStop Kernel.
Bruno Haible <bruno@clisp.org>
parents: 14010
diff changeset
73 on most platforms. */
68009ff4e161 sys_select: Ensure all necessary types on NonStop Kernel.
Bruno Haible <bruno@clisp.org>
parents: 14010
diff changeset
74 # include <sys/time.h>
14062
a9b8cdb01be3 sys_select: Avoid warning about missing memset declaration on HP-UX 11.
Bruno Haible <bruno@clisp.org>
parents: 14011
diff changeset
75 /* On HP-UX 11, <sys/time.h> provides an FD_ZERO implementation
a9b8cdb01be3 sys_select: Avoid warning about missing memset declaration on HP-UX 11.
Bruno Haible <bruno@clisp.org>
parents: 14011
diff changeset
76 that relies on memset(), but without including <string.h>. */
a9b8cdb01be3 sys_select: Avoid warning about missing memset declaration on HP-UX 11.
Bruno Haible <bruno@clisp.org>
parents: 14011
diff changeset
77 # if defined __hpux
a9b8cdb01be3 sys_select: Avoid warning about missing memset declaration on HP-UX 11.
Bruno Haible <bruno@clisp.org>
parents: 14011
diff changeset
78 # include <string.h>
a9b8cdb01be3 sys_select: Avoid warning about missing memset declaration on HP-UX 11.
Bruno Haible <bruno@clisp.org>
parents: 14011
diff changeset
79 # endif
14010
fd62a5de1a49 sys_select: Remove unneeded include.
Bruno Haible <bruno@clisp.org>
parents: 13783
diff changeset
80 /* On native Windows platforms:
fd62a5de1a49 sys_select: Remove unneeded include.
Bruno Haible <bruno@clisp.org>
parents: 13783
diff changeset
81 Get the 'fd_set' type. Also, gnulib's <sys/socket.h> redefines select
fd62a5de1a49 sys_select: Remove unneeded include.
Bruno Haible <bruno@clisp.org>
parents: 13783
diff changeset
82 so as to hide the declaration from <winsock2.h>. */
12944
e105c6e52c5d sys_select: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12875
diff changeset
83 # include <sys/socket.h>
e105c6e52c5d sys_select: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12875
diff changeset
84 #endif
9265
6c8579ddc19d Rename sys_select_.h to sys_select.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
85
12944
e105c6e52c5d sys_select: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12875
diff changeset
86 /* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
9265
6c8579ddc19d Rename sys_select_.h to sys_select.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
87
12766
2c14f1e449e5 warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents: 12559
diff changeset
88 /* The definition of _GL_WARN_ON_USE is copied here. */
10539
affb655993ea Make the headers usable in C++.
Bruno Haible <bruno@clisp.org>
parents: 10474
diff changeset
89
affb655993ea Make the headers usable in C++.
Bruno Haible <bruno@clisp.org>
parents: 10474
diff changeset
90
12944
e105c6e52c5d sys_select: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12875
diff changeset
91 #if @GNULIB_SELECT@
e105c6e52c5d sys_select: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12875
diff changeset
92 # if @HAVE_WINSOCK2_H@ || @REPLACE_SELECT@
e105c6e52c5d sys_select: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12875
diff changeset
93 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
10586
ca7f9b88efc1 New module 'select'.
Bruno Haible <bruno@clisp.org>
parents: 10541
diff changeset
94 # undef select
ca7f9b88efc1 New module 'select'.
Bruno Haible <bruno@clisp.org>
parents: 10541
diff changeset
95 # define select rpl_select
ca7f9b88efc1 New module 'select'.
Bruno Haible <bruno@clisp.org>
parents: 10541
diff changeset
96 # endif
12944
e105c6e52c5d sys_select: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12875
diff changeset
97 _GL_FUNCDECL_RPL (select, int,
e105c6e52c5d sys_select: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12875
diff changeset
98 (int, fd_set *, fd_set *, fd_set *, struct timeval *));
e105c6e52c5d sys_select: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12875
diff changeset
99 _GL_CXXALIAS_RPL (select, int,
e105c6e52c5d sys_select: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12875
diff changeset
100 (int, fd_set *, fd_set *, fd_set *, struct timeval *));
e105c6e52c5d sys_select: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12875
diff changeset
101 # else
e105c6e52c5d sys_select: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12875
diff changeset
102 _GL_CXXALIAS_SYS (select, int,
e105c6e52c5d sys_select: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12875
diff changeset
103 (int, fd_set *, fd_set *, fd_set *, struct timeval *));
e105c6e52c5d sys_select: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12875
diff changeset
104 # endif
e105c6e52c5d sys_select: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12875
diff changeset
105 _GL_CXXALIASWARN (select);
e105c6e52c5d sys_select: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12875
diff changeset
106 #elif @HAVE_WINSOCK2_H@
e105c6e52c5d sys_select: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12875
diff changeset
107 # undef select
e105c6e52c5d sys_select: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12875
diff changeset
108 # define select select_used_without_requesting_gnulib_module_select
e105c6e52c5d sys_select: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12875
diff changeset
109 #elif defined GNULIB_POSIXCHECK
e105c6e52c5d sys_select: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12875
diff changeset
110 # undef select
e105c6e52c5d sys_select: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12875
diff changeset
111 # if HAVE_RAW_DECL_SELECT
12766
2c14f1e449e5 warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents: 12559
diff changeset
112 _GL_WARN_ON_USE (select, "select is not always POSIX compliant - "
2c14f1e449e5 warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents: 12559
diff changeset
113 "use gnulib module select for portability");
10591
9a7657d2031f Add a link warning when the 'select' module is not used.
Bruno Haible <bruno@clisp.org>
parents: 10586
diff changeset
114 # endif
12944
e105c6e52c5d sys_select: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12875
diff changeset
115 #endif
10474
5fc74f43b3d6 implement full-blown select(2) for winsock
Paolo Bonzini <bonzini@gnu.org>
parents: 10375
diff changeset
116
9265
6c8579ddc19d Rename sys_select_.h to sys_select.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
117
6c8579ddc19d Rename sys_select_.h to sys_select.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
118 #endif /* _GL_SYS_SELECT_H */
6c8579ddc19d Rename sys_select_.h to sys_select.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
119 #endif /* _GL_SYS_SELECT_H */
10882
3c51cf16c4fa Fix compilation error on OSF/1 4.0.
Bruno Haible <bruno@clisp.org>
parents: 10655
diff changeset
120 #endif /* OSF/1 */