annotate lib/poll.in.h @ 40186:8964917f9574

autoupdate
author Karl Berry <karl@freefriends.org>
date Mon, 18 Feb 2019 08:02:49 -0800
parents b06060465f09
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
9257
bba0d44b7c23 Rename poll_.h to poll.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1 /* Header for poll(2) emulation
bba0d44b7c23 Rename poll_.h to poll.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2 Contributed by Paolo Bonzini.
bba0d44b7c23 Rename poll_.h to poll.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
3
40057
b06060465f09 maint: Run 'make update-copyright'
Paul Eggert <eggert@cs.ucla.edu>
parents: 19484
diff changeset
4 Copyright 2001-2003, 2007, 2009-2019 Free Software Foundation, Inc.
9257
bba0d44b7c23 Rename poll_.h to poll.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
5
bba0d44b7c23 Rename poll_.h to poll.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
6 This file is part of gnulib.
bba0d44b7c23 Rename poll_.h to poll.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
7
bba0d44b7c23 Rename poll_.h to poll.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
8 This program is free software; you can redistribute it and/or modify
bba0d44b7c23 Rename poll_.h to poll.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
9 it under the terms of the GNU General Public License as published by
bba0d44b7c23 Rename poll_.h to poll.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
10 the Free Software Foundation; either version 2, or (at your option)
bba0d44b7c23 Rename poll_.h to poll.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
11 any later version.
bba0d44b7c23 Rename poll_.h to poll.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
12
bba0d44b7c23 Rename poll_.h to poll.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
13 This program is distributed in the hope that it will be useful,
bba0d44b7c23 Rename poll_.h to poll.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
bba0d44b7c23 Rename poll_.h to poll.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
bba0d44b7c23 Rename poll_.h to poll.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
16 GNU General Public License for more details.
bba0d44b7c23 Rename poll_.h to poll.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
17
bba0d44b7c23 Rename poll_.h to poll.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
18 You should have received a copy of the GNU General Public License along
19190
9759915b2aca all: prefer https: URLs
Paul Eggert <eggert@cs.ucla.edu>
parents: 18626
diff changeset
19 with this program; if not, see <https://www.gnu.org/licenses/>. */
9257
bba0d44b7c23 Rename poll_.h to poll.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
20
14840
5f709022a256 Allow multiple gnulib generated include files to be combined.
Bruno Haible <bruno@clisp.org>
parents: 14274
diff changeset
21 #ifndef _@GUARD_PREFIX@_POLL_H
13740
39e9b3545aed poll-h: Create poll.h on all platforms.
Bruno Haible <bruno@clisp.org>
parents: 13736
diff changeset
22
39e9b3545aed poll-h: Create poll.h on all platforms.
Bruno Haible <bruno@clisp.org>
parents: 13736
diff changeset
23 #if __GNUC__ >= 3
39e9b3545aed poll-h: Create poll.h on all platforms.
Bruno Haible <bruno@clisp.org>
parents: 13736
diff changeset
24 @PRAGMA_SYSTEM_HEADER@
39e9b3545aed poll-h: Create poll.h on all platforms.
Bruno Haible <bruno@clisp.org>
parents: 13736
diff changeset
25 #endif
13761
a19ace3ba849 Avoid line length limitation from HP NonStop system header files.
Bruno Haible <bruno@clisp.org>
parents: 13740
diff changeset
26 @PRAGMA_COLUMNS@
13740
39e9b3545aed poll-h: Create poll.h on all platforms.
Bruno Haible <bruno@clisp.org>
parents: 13736
diff changeset
27
39e9b3545aed poll-h: Create poll.h on all platforms.
Bruno Haible <bruno@clisp.org>
parents: 13736
diff changeset
28 /* The include_next requires a split double-inclusion guard. */
39e9b3545aed poll-h: Create poll.h on all platforms.
Bruno Haible <bruno@clisp.org>
parents: 13736
diff changeset
29 #if @HAVE_POLL_H@
39e9b3545aed poll-h: Create poll.h on all platforms.
Bruno Haible <bruno@clisp.org>
parents: 13736
diff changeset
30 # @INCLUDE_NEXT@ @NEXT_POLL_H@
39e9b3545aed poll-h: Create poll.h on all platforms.
Bruno Haible <bruno@clisp.org>
parents: 13736
diff changeset
31 #endif
39e9b3545aed poll-h: Create poll.h on all platforms.
Bruno Haible <bruno@clisp.org>
parents: 13736
diff changeset
32
14840
5f709022a256 Allow multiple gnulib generated include files to be combined.
Bruno Haible <bruno@clisp.org>
parents: 14274
diff changeset
33 #ifndef _@GUARD_PREFIX@_POLL_H
5f709022a256 Allow multiple gnulib generated include files to be combined.
Bruno Haible <bruno@clisp.org>
parents: 14274
diff changeset
34 #define _@GUARD_PREFIX@_POLL_H
9257
bba0d44b7c23 Rename poll_.h to poll.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
35
13736
10928671f716 New module 'poll-h'.
Bruno Haible <bruno@clisp.org>
parents: 12559
diff changeset
36
10928671f716 New module 'poll-h'.
Bruno Haible <bruno@clisp.org>
parents: 12559
diff changeset
37 /* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
10928671f716 New module 'poll-h'.
Bruno Haible <bruno@clisp.org>
parents: 12559
diff changeset
38
10928671f716 New module 'poll-h'.
Bruno Haible <bruno@clisp.org>
parents: 12559
diff changeset
39 /* The definition of _GL_WARN_ON_USE is copied here. */
10928671f716 New module 'poll-h'.
Bruno Haible <bruno@clisp.org>
parents: 12559
diff changeset
40
10928671f716 New module 'poll-h'.
Bruno Haible <bruno@clisp.org>
parents: 12559
diff changeset
41
13740
39e9b3545aed poll-h: Create poll.h on all platforms.
Bruno Haible <bruno@clisp.org>
parents: 13736
diff changeset
42 #if !@HAVE_POLL_H@
39e9b3545aed poll-h: Create poll.h on all platforms.
Bruno Haible <bruno@clisp.org>
parents: 13736
diff changeset
43
9257
bba0d44b7c23 Rename poll_.h to poll.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
44 /* fake a poll(2) environment */
13740
39e9b3545aed poll-h: Create poll.h on all platforms.
Bruno Haible <bruno@clisp.org>
parents: 13736
diff changeset
45 # define POLLIN 0x0001 /* any readable data available */
39e9b3545aed poll-h: Create poll.h on all platforms.
Bruno Haible <bruno@clisp.org>
parents: 13736
diff changeset
46 # define POLLPRI 0x0002 /* OOB/Urgent readable data */
16358
a712776b11ce maint: spelling fixes
Paul Eggert <eggert@cs.ucla.edu>
parents: 16201
diff changeset
47 # define POLLOUT 0x0004 /* file descriptor is writable */
13740
39e9b3545aed poll-h: Create poll.h on all platforms.
Bruno Haible <bruno@clisp.org>
parents: 13736
diff changeset
48 # define POLLERR 0x0008 /* some poll error occurred */
39e9b3545aed poll-h: Create poll.h on all platforms.
Bruno Haible <bruno@clisp.org>
parents: 13736
diff changeset
49 # define POLLHUP 0x0010 /* file descriptor was "hung up" */
39e9b3545aed poll-h: Create poll.h on all platforms.
Bruno Haible <bruno@clisp.org>
parents: 13736
diff changeset
50 # define POLLNVAL 0x0020 /* requested events "invalid" */
39e9b3545aed poll-h: Create poll.h on all platforms.
Bruno Haible <bruno@clisp.org>
parents: 13736
diff changeset
51 # define POLLRDNORM 0x0040
39e9b3545aed poll-h: Create poll.h on all platforms.
Bruno Haible <bruno@clisp.org>
parents: 13736
diff changeset
52 # define POLLRDBAND 0x0080
39e9b3545aed poll-h: Create poll.h on all platforms.
Bruno Haible <bruno@clisp.org>
parents: 13736
diff changeset
53 # define POLLWRNORM 0x0100
39e9b3545aed poll-h: Create poll.h on all platforms.
Bruno Haible <bruno@clisp.org>
parents: 13736
diff changeset
54 # define POLLWRBAND 0x0200
9257
bba0d44b7c23 Rename poll_.h to poll.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
55
14274
da5595160b9f Allow multiple gnulib generated replacements to coexist.
Bruno Haible <bruno@clisp.org>
parents: 14079
diff changeset
56 # if !GNULIB_defined_poll_types
da5595160b9f Allow multiple gnulib generated replacements to coexist.
Bruno Haible <bruno@clisp.org>
parents: 14079
diff changeset
57
9257
bba0d44b7c23 Rename poll_.h to poll.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
58 struct pollfd
bba0d44b7c23 Rename poll_.h to poll.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
59 {
12421
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 9257
diff changeset
60 int fd; /* which file descriptor to poll */
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 9257
diff changeset
61 short events; /* events we are interested in */
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 9257
diff changeset
62 short revents; /* events found on return */
9257
bba0d44b7c23 Rename poll_.h to poll.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
63 };
bba0d44b7c23 Rename poll_.h to poll.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
64
bba0d44b7c23 Rename poll_.h to poll.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
65 typedef unsigned long nfds_t;
bba0d44b7c23 Rename poll_.h to poll.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
66
14274
da5595160b9f Allow multiple gnulib generated replacements to coexist.
Bruno Haible <bruno@clisp.org>
parents: 14079
diff changeset
67 # define GNULIB_defined_poll_types 1
da5595160b9f Allow multiple gnulib generated replacements to coexist.
Bruno Haible <bruno@clisp.org>
parents: 14079
diff changeset
68 # endif
da5595160b9f Allow multiple gnulib generated replacements to coexist.
Bruno Haible <bruno@clisp.org>
parents: 14079
diff changeset
69
13740
39e9b3545aed poll-h: Create poll.h on all platforms.
Bruno Haible <bruno@clisp.org>
parents: 13736
diff changeset
70 /* Define INFTIM only if doing so conforms to POSIX. */
39e9b3545aed poll-h: Create poll.h on all platforms.
Bruno Haible <bruno@clisp.org>
parents: 13736
diff changeset
71 # if !defined (_POSIX_C_SOURCE) && !defined (_XOPEN_SOURCE)
39e9b3545aed poll-h: Create poll.h on all platforms.
Bruno Haible <bruno@clisp.org>
parents: 13736
diff changeset
72 # define INFTIM (-1)
39e9b3545aed poll-h: Create poll.h on all platforms.
Bruno Haible <bruno@clisp.org>
parents: 13736
diff changeset
73 # endif
39e9b3545aed poll-h: Create poll.h on all platforms.
Bruno Haible <bruno@clisp.org>
parents: 13736
diff changeset
74
39e9b3545aed poll-h: Create poll.h on all platforms.
Bruno Haible <bruno@clisp.org>
parents: 13736
diff changeset
75 #endif
39e9b3545aed poll-h: Create poll.h on all platforms.
Bruno Haible <bruno@clisp.org>
parents: 13736
diff changeset
76
39e9b3545aed poll-h: Create poll.h on all platforms.
Bruno Haible <bruno@clisp.org>
parents: 13736
diff changeset
77
13736
10928671f716 New module 'poll-h'.
Bruno Haible <bruno@clisp.org>
parents: 12559
diff changeset
78 #if @GNULIB_POLL@
10928671f716 New module 'poll-h'.
Bruno Haible <bruno@clisp.org>
parents: 12559
diff changeset
79 # if @REPLACE_POLL@
10928671f716 New module 'poll-h'.
Bruno Haible <bruno@clisp.org>
parents: 12559
diff changeset
80 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
10928671f716 New module 'poll-h'.
Bruno Haible <bruno@clisp.org>
parents: 12559
diff changeset
81 # undef poll
10928671f716 New module 'poll-h'.
Bruno Haible <bruno@clisp.org>
parents: 12559
diff changeset
82 # define poll rpl_poll
10928671f716 New module 'poll-h'.
Bruno Haible <bruno@clisp.org>
parents: 12559
diff changeset
83 # endif
10928671f716 New module 'poll-h'.
Bruno Haible <bruno@clisp.org>
parents: 12559
diff changeset
84 _GL_FUNCDECL_RPL (poll, int, (struct pollfd *pfd, nfds_t nfd, int timeout));
10928671f716 New module 'poll-h'.
Bruno Haible <bruno@clisp.org>
parents: 12559
diff changeset
85 _GL_CXXALIAS_RPL (poll, int, (struct pollfd *pfd, nfds_t nfd, int timeout));
10928671f716 New module 'poll-h'.
Bruno Haible <bruno@clisp.org>
parents: 12559
diff changeset
86 # else
10928671f716 New module 'poll-h'.
Bruno Haible <bruno@clisp.org>
parents: 12559
diff changeset
87 # if !@HAVE_POLL@
10928671f716 New module 'poll-h'.
Bruno Haible <bruno@clisp.org>
parents: 12559
diff changeset
88 _GL_FUNCDECL_SYS (poll, int, (struct pollfd *pfd, nfds_t nfd, int timeout));
10928671f716 New module 'poll-h'.
Bruno Haible <bruno@clisp.org>
parents: 12559
diff changeset
89 # endif
10928671f716 New module 'poll-h'.
Bruno Haible <bruno@clisp.org>
parents: 12559
diff changeset
90 _GL_CXXALIAS_SYS (poll, int, (struct pollfd *pfd, nfds_t nfd, int timeout));
10928671f716 New module 'poll-h'.
Bruno Haible <bruno@clisp.org>
parents: 12559
diff changeset
91 # endif
10928671f716 New module 'poll-h'.
Bruno Haible <bruno@clisp.org>
parents: 12559
diff changeset
92 _GL_CXXALIASWARN (poll);
10928671f716 New module 'poll-h'.
Bruno Haible <bruno@clisp.org>
parents: 12559
diff changeset
93 #elif defined GNULIB_POSIXCHECK
10928671f716 New module 'poll-h'.
Bruno Haible <bruno@clisp.org>
parents: 12559
diff changeset
94 # undef poll
10928671f716 New module 'poll-h'.
Bruno Haible <bruno@clisp.org>
parents: 12559
diff changeset
95 # if HAVE_RAW_DECL_POLL
10928671f716 New module 'poll-h'.
Bruno Haible <bruno@clisp.org>
parents: 12559
diff changeset
96 _GL_WARN_ON_USE (poll, "poll is unportable - "
10928671f716 New module 'poll-h'.
Bruno Haible <bruno@clisp.org>
parents: 12559
diff changeset
97 "use gnulib module poll for portability");
10928671f716 New module 'poll-h'.
Bruno Haible <bruno@clisp.org>
parents: 12559
diff changeset
98 # endif
10928671f716 New module 'poll-h'.
Bruno Haible <bruno@clisp.org>
parents: 12559
diff changeset
99 #endif
9257
bba0d44b7c23 Rename poll_.h to poll.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
100
13736
10928671f716 New module 'poll-h'.
Bruno Haible <bruno@clisp.org>
parents: 12559
diff changeset
101
14840
5f709022a256 Allow multiple gnulib generated include files to be combined.
Bruno Haible <bruno@clisp.org>
parents: 14274
diff changeset
102 #endif /* _@GUARD_PREFIX@_POLL_H */
5f709022a256 Allow multiple gnulib generated include files to be combined.
Bruno Haible <bruno@clisp.org>
parents: 14274
diff changeset
103 #endif /* _@GUARD_PREFIX@_POLL_H */