annotate lib/sys_select.in.h @ 30232:93e5702f1344

strengthen self-containedness check for sys/select.h 2008-09-29 Paolo Bonzini <bonzini@gnu.org> Bruno Haible <bruno@clisp.org> * lib/sys_select.in.h: Include sys/time.h. * m4/sys_select.h.m4: Test that struct timeval is fully defined. * modules/sys_select: Depend on sys_time. * tests/test-sys_select.c: Test that sys/select.h defines struct timeval fully.
author Paolo Bonzini <bonzini@gnu.org>
date Mon, 29 Sep 2008 12:02:35 +0200
parents d0e994df59ca
children ca7f9b88efc1
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
28956
f33715f2cf81 Rename sys_select_.h to sys_select.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1 /* Substitute for <sys/select.h>.
30066
7902c57e7155 Avoid some "gcc -pedantic" warnings.
Bruno Haible <bruno@clisp.org>
parents: 28956
diff changeset
2 Copyright (C) 2007-2008 Free Software Foundation, Inc.
28956
f33715f2cf81 Rename sys_select_.h to sys_select.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
3
f33715f2cf81 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
f33715f2cf81 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
f33715f2cf81 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)
f33715f2cf81 Rename sys_select_.h to sys_select.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
7 any later version.
f33715f2cf81 Rename sys_select_.h to sys_select.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
8
f33715f2cf81 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,
f33715f2cf81 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
f33715f2cf81 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
f33715f2cf81 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.
f33715f2cf81 Rename sys_select_.h to sys_select.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
13
f33715f2cf81 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
f33715f2cf81 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,
f33715f2cf81 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. */
f33715f2cf81 Rename sys_select_.h to sys_select.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
17
f33715f2cf81 Rename sys_select_.h to sys_select.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
18 #ifndef _GL_SYS_SELECT_H
f33715f2cf81 Rename sys_select_.h to sys_select.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
19
f33715f2cf81 Rename sys_select_.h to sys_select.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
20 #if @HAVE_SYS_SELECT_H@
f33715f2cf81 Rename sys_select_.h to sys_select.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
21
30066
7902c57e7155 Avoid some "gcc -pedantic" warnings.
Bruno Haible <bruno@clisp.org>
parents: 28956
diff changeset
22 @PRAGMA_SYSTEM_HEADER@
7902c57e7155 Avoid some "gcc -pedantic" warnings.
Bruno Haible <bruno@clisp.org>
parents: 28956
diff changeset
23
28956
f33715f2cf81 Rename sys_select_.h to sys_select.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
24 /* On many platforms, <sys/select.h> assumes prior inclusion of
f33715f2cf81 Rename sys_select_.h to sys_select.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
25 <sys/types.h>. */
f33715f2cf81 Rename sys_select_.h to sys_select.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
26 # include <sys/types.h>
f33715f2cf81 Rename sys_select_.h to sys_select.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
27
30232
93e5702f1344 strengthen self-containedness check for sys/select.h
Paolo Bonzini <bonzini@gnu.org>
parents: 30230
diff changeset
28 /* On OSF/1 4.0, <sys/select.h> provides only a forward declaration
93e5702f1344 strengthen self-containedness check for sys/select.h
Paolo Bonzini <bonzini@gnu.org>
parents: 30230
diff changeset
29 of 'struct timeval', and no definition of this type.. */
93e5702f1344 strengthen self-containedness check for sys/select.h
Paolo Bonzini <bonzini@gnu.org>
parents: 30230
diff changeset
30 # include <sys/time.h>
93e5702f1344 strengthen self-containedness check for sys/select.h
Paolo Bonzini <bonzini@gnu.org>
parents: 30230
diff changeset
31
28956
f33715f2cf81 Rename sys_select_.h to sys_select.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
32 /* The include_next requires a split double-inclusion guard. */
f33715f2cf81 Rename sys_select_.h to sys_select.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
33 # @INCLUDE_NEXT@ @NEXT_SYS_SELECT_H@
f33715f2cf81 Rename sys_select_.h to sys_select.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
34
f33715f2cf81 Rename sys_select_.h to sys_select.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
35 #endif
f33715f2cf81 Rename sys_select_.h to sys_select.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
36
f33715f2cf81 Rename sys_select_.h to sys_select.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
37 #ifndef _GL_SYS_SELECT_H
f33715f2cf81 Rename sys_select_.h to sys_select.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
38 #define _GL_SYS_SELECT_H
f33715f2cf81 Rename sys_select_.h to sys_select.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
39
f33715f2cf81 Rename sys_select_.h to sys_select.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
40 #if !@HAVE_SYS_SELECT_H@
f33715f2cf81 Rename sys_select_.h to sys_select.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
41
f33715f2cf81 Rename sys_select_.h to sys_select.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
42 /* A platform that lacks <sys/select.h>. */
f33715f2cf81 Rename sys_select_.h to sys_select.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
43
f33715f2cf81 Rename sys_select_.h to sys_select.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
44 # include <sys/socket.h>
f33715f2cf81 Rename sys_select_.h to sys_select.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
45
30165
9ecf84bb4ac5 implement full-blown select(2) for winsock
Paolo Bonzini <bonzini@gnu.org>
parents: 30066
diff changeset
46 # if @HAVE_WINSOCK2_H@
30230
d0e994df59ca Make the headers usable in C++.
Bruno Haible <bruno@clisp.org>
parents: 30165
diff changeset
47
d0e994df59ca Make the headers usable in C++.
Bruno Haible <bruno@clisp.org>
parents: 30165
diff changeset
48 # ifdef __cplusplus
d0e994df59ca Make the headers usable in C++.
Bruno Haible <bruno@clisp.org>
parents: 30165
diff changeset
49 extern "C" {
d0e994df59ca Make the headers usable in C++.
Bruno Haible <bruno@clisp.org>
parents: 30165
diff changeset
50 # endif
d0e994df59ca Make the headers usable in C++.
Bruno Haible <bruno@clisp.org>
parents: 30165
diff changeset
51
30165
9ecf84bb4ac5 implement full-blown select(2) for winsock
Paolo Bonzini <bonzini@gnu.org>
parents: 30066
diff changeset
52 # undef select
9ecf84bb4ac5 implement full-blown select(2) for winsock
Paolo Bonzini <bonzini@gnu.org>
parents: 30066
diff changeset
53 # define select rpl_select
30230
d0e994df59ca Make the headers usable in C++.
Bruno Haible <bruno@clisp.org>
parents: 30165
diff changeset
54 extern int rpl_select (int, fd_set *, fd_set *, fd_set *, struct timeval *);
30165
9ecf84bb4ac5 implement full-blown select(2) for winsock
Paolo Bonzini <bonzini@gnu.org>
parents: 30066
diff changeset
55
30230
d0e994df59ca Make the headers usable in C++.
Bruno Haible <bruno@clisp.org>
parents: 30165
diff changeset
56 # ifdef __cplusplus
d0e994df59ca Make the headers usable in C++.
Bruno Haible <bruno@clisp.org>
parents: 30165
diff changeset
57 }
d0e994df59ca Make the headers usable in C++.
Bruno Haible <bruno@clisp.org>
parents: 30165
diff changeset
58 # endif
d0e994df59ca Make the headers usable in C++.
Bruno Haible <bruno@clisp.org>
parents: 30165
diff changeset
59
30165
9ecf84bb4ac5 implement full-blown select(2) for winsock
Paolo Bonzini <bonzini@gnu.org>
parents: 30066
diff changeset
60 # endif
9ecf84bb4ac5 implement full-blown select(2) for winsock
Paolo Bonzini <bonzini@gnu.org>
parents: 30066
diff changeset
61
28956
f33715f2cf81 Rename sys_select_.h to sys_select.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
62 #endif
f33715f2cf81 Rename sys_select_.h to sys_select.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
63
f33715f2cf81 Rename sys_select_.h to sys_select.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
64 #endif /* _GL_SYS_SELECT_H */
f33715f2cf81 Rename sys_select_.h to sys_select.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
65 #endif /* _GL_SYS_SELECT_H */