Mercurial > gnulib
annotate lib/sys_select.in.h @ 10586:ca7f9b88efc1
New module 'select'.
author | Bruno Haible <bruno@clisp.org> |
---|---|
date | Sun, 05 Oct 2008 17:20:58 +0200 |
parents | 142140ec3db8 |
children | 9a7657d2031f |
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>. |
10375
f96e845fc36d
Avoid some "gcc -pedantic" warnings.
Bruno Haible <bruno@clisp.org>
parents:
9265
diff
changeset
|
2 Copyright (C) 2007-2008 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 |
6c8579ddc19d
Rename sys_select_.h to sys_select.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
18 #ifndef _GL_SYS_SELECT_H |
6c8579ddc19d
Rename sys_select_.h to sys_select.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
19 |
6c8579ddc19d
Rename sys_select_.h to sys_select.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
20 #if @HAVE_SYS_SELECT_H@ |
6c8579ddc19d
Rename sys_select_.h to sys_select.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
21 |
10375
f96e845fc36d
Avoid some "gcc -pedantic" warnings.
Bruno Haible <bruno@clisp.org>
parents:
9265
diff
changeset
|
22 @PRAGMA_SYSTEM_HEADER@ |
f96e845fc36d
Avoid some "gcc -pedantic" warnings.
Bruno Haible <bruno@clisp.org>
parents:
9265
diff
changeset
|
23 |
9265
6c8579ddc19d
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 |
6c8579ddc19d
Rename sys_select_.h to sys_select.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
25 <sys/types.h>. */ |
6c8579ddc19d
Rename sys_select_.h to sys_select.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
26 # include <sys/types.h> |
6c8579ddc19d
Rename sys_select_.h to sys_select.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
27 |
10541
142140ec3db8
strengthen self-containedness check for sys/select.h
Paolo Bonzini <bonzini@gnu.org>
parents:
10539
diff
changeset
|
28 /* On OSF/1 4.0, <sys/select.h> provides only a forward declaration |
142140ec3db8
strengthen self-containedness check for sys/select.h
Paolo Bonzini <bonzini@gnu.org>
parents:
10539
diff
changeset
|
29 of 'struct timeval', and no definition of this type.. */ |
142140ec3db8
strengthen self-containedness check for sys/select.h
Paolo Bonzini <bonzini@gnu.org>
parents:
10539
diff
changeset
|
30 # include <sys/time.h> |
142140ec3db8
strengthen self-containedness check for sys/select.h
Paolo Bonzini <bonzini@gnu.org>
parents:
10539
diff
changeset
|
31 |
9265
6c8579ddc19d
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. */ |
6c8579ddc19d
Rename sys_select_.h to sys_select.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
33 # @INCLUDE_NEXT@ @NEXT_SYS_SELECT_H@ |
6c8579ddc19d
Rename sys_select_.h to sys_select.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
34 |
6c8579ddc19d
Rename sys_select_.h to sys_select.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
35 #endif |
6c8579ddc19d
Rename sys_select_.h to sys_select.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
36 |
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 #define _GL_SYS_SELECT_H |
6c8579ddc19d
Rename sys_select_.h to sys_select.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
39 |
6c8579ddc19d
Rename sys_select_.h to sys_select.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
40 #if !@HAVE_SYS_SELECT_H@ |
6c8579ddc19d
Rename sys_select_.h to sys_select.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
41 |
6c8579ddc19d
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>. */ |
6c8579ddc19d
Rename sys_select_.h to sys_select.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
43 |
6c8579ddc19d
Rename sys_select_.h to sys_select.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
44 # include <sys/socket.h> |
6c8579ddc19d
Rename sys_select_.h to sys_select.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
45 |
10474
5fc74f43b3d6
implement full-blown select(2) for winsock
Paolo Bonzini <bonzini@gnu.org>
parents:
10375
diff
changeset
|
46 # if @HAVE_WINSOCK2_H@ |
10539
affb655993ea
Make the headers usable in C++.
Bruno Haible <bruno@clisp.org>
parents:
10474
diff
changeset
|
47 |
affb655993ea
Make the headers usable in C++.
Bruno Haible <bruno@clisp.org>
parents:
10474
diff
changeset
|
48 # ifdef __cplusplus |
affb655993ea
Make the headers usable in C++.
Bruno Haible <bruno@clisp.org>
parents:
10474
diff
changeset
|
49 extern "C" { |
affb655993ea
Make the headers usable in C++.
Bruno Haible <bruno@clisp.org>
parents:
10474
diff
changeset
|
50 # endif |
affb655993ea
Make the headers usable in C++.
Bruno Haible <bruno@clisp.org>
parents:
10474
diff
changeset
|
51 |
10586 | 52 # if @GNULIB_SELECT@ |
53 # undef select | |
54 # define select rpl_select | |
10539
affb655993ea
Make the headers usable in C++.
Bruno Haible <bruno@clisp.org>
parents:
10474
diff
changeset
|
55 extern int rpl_select (int, fd_set *, fd_set *, fd_set *, struct timeval *); |
10586 | 56 # else |
57 # undef select | |
58 # define select select_used_without_requesting_gnulib_module_select | |
59 # endif | |
10474
5fc74f43b3d6
implement full-blown select(2) for winsock
Paolo Bonzini <bonzini@gnu.org>
parents:
10375
diff
changeset
|
60 |
10539
affb655993ea
Make the headers usable in C++.
Bruno Haible <bruno@clisp.org>
parents:
10474
diff
changeset
|
61 # ifdef __cplusplus |
affb655993ea
Make the headers usable in C++.
Bruno Haible <bruno@clisp.org>
parents:
10474
diff
changeset
|
62 } |
affb655993ea
Make the headers usable in C++.
Bruno Haible <bruno@clisp.org>
parents:
10474
diff
changeset
|
63 # endif |
affb655993ea
Make the headers usable in C++.
Bruno Haible <bruno@clisp.org>
parents:
10474
diff
changeset
|
64 |
10474
5fc74f43b3d6
implement full-blown select(2) for winsock
Paolo Bonzini <bonzini@gnu.org>
parents:
10375
diff
changeset
|
65 # endif |
5fc74f43b3d6
implement full-blown select(2) for winsock
Paolo Bonzini <bonzini@gnu.org>
parents:
10375
diff
changeset
|
66 |
9265
6c8579ddc19d
Rename sys_select_.h to sys_select.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
67 #endif |
6c8579ddc19d
Rename sys_select_.h to sys_select.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
68 |
6c8579ddc19d
Rename sys_select_.h to sys_select.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
69 #endif /* _GL_SYS_SELECT_H */ |
6c8579ddc19d
Rename sys_select_.h to sys_select.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
70 #endif /* _GL_SYS_SELECT_H */ |