Print this page
remove support for non-ANSI compilation
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/uts/common/sys/poll.h
+++ new/usr/src/uts/common/sys/poll.h
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License, Version 1.0 only
6 6 * (the "License"). You may not use this file except in compliance
7 7 * with the License.
8 8 *
9 9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 10 * or http://www.opensolaris.org/os/licensing.
11 11 * See the License for the specific language governing permissions
12 12 * and limitations under the License.
13 13 *
14 14 * When distributing Covered Code, include this CDDL HEADER in each
15 15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 16 * If applicable, add the following below this CDDL HEADER, with the
↓ open down ↓ |
16 lines elided |
↑ open up ↑ |
17 17 * fields enclosed by brackets "[]" replaced with your own identifying
18 18 * information: Portions Copyright [yyyy] [name of copyright owner]
19 19 *
20 20 * CDDL HEADER END
21 21 */
22 22 /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
23 23 /* All Rights Reserved */
24 24
25 25
26 26 /*
27 + * Copyright 2014 Garrett D'Amore <garrett@damore.org>
28 + *
27 29 * Copyright (c) 1995, 1998 by Sun Microsystems, Inc.
28 30 * All rights reserved.
29 31 */
30 32
31 33 #ifndef _SYS_POLL_H
32 34 #define _SYS_POLL_H
33 35
34 -#pragma ident "%Z%%M% %I% %E% SMI" /* SVr4.0 11.9 */
35 -
36 36 #ifdef __cplusplus
37 37 extern "C" {
38 38 #endif
39 39
40 40 /*
41 41 * Structure of file descriptor/event pairs supplied in
42 42 * the poll arrays.
43 43 */
44 44 typedef struct pollfd {
45 45 int fd; /* file desc to poll */
46 46 short events; /* events of interest on fd */
47 47 short revents; /* events that occurred on fd */
48 48 } pollfd_t;
49 49
50 50 typedef unsigned long nfds_t;
51 51
52 52 /*
53 53 * Testable select events
54 54 */
55 55 #define POLLIN 0x0001 /* fd is readable */
56 56 #define POLLPRI 0x0002 /* high priority info at fd */
57 57 #define POLLOUT 0x0004 /* fd is writeable (won't block) */
58 58 #define POLLRDNORM 0x0040 /* normal data is readable */
59 59 #define POLLWRNORM POLLOUT
60 60 #define POLLRDBAND 0x0080 /* out-of-band data is readable */
61 61 #define POLLWRBAND 0x0100 /* out-of-band data is writeable */
62 62
63 63 #define POLLNORM POLLRDNORM
64 64
65 65 /*
66 66 * Non-testable poll events (may not be specified in events field,
67 67 * but may be returned in revents field).
68 68 */
69 69 #define POLLERR 0x0008 /* fd has error condition */
70 70 #define POLLHUP 0x0010 /* fd has been hung up on */
71 71 #define POLLNVAL 0x0020 /* invalid pollfd entry */
72 72
73 73 #define POLLREMOVE 0x0800 /* remove a cached poll fd from /dev/poll */
74 74
75 75 #ifdef _KERNEL
76 76
77 77 /*
78 78 * Additional private poll flags supported only by strpoll().
79 79 * Must be bit-wise distinct from the above POLL flags.
80 80 */
81 81 #define POLLRDDATA 0x0200 /* Wait for M_DATA; ignore M_PROTO only msgs */
82 82 #define POLLNOERR 0x0400 /* Ignore POLLERR conditions */
83 83
84 84 #define POLLCLOSED 0x8000 /* a (cached) poll fd has been closed */
85 85
86 86 #endif /* _KERNEL */
87 87
88 88 #if defined(_KERNEL) || defined(_KMEMUSER)
89 89
90 90 #include <sys/thread.h>
91 91
92 92 /*
93 93 * XXX We are forced to use a forward reference here because including
94 94 * file.h here will break i386 build. The real solution is to fix the
95 95 * broken parts in usr/src/stand/lib/fs.
96 96 */
97 97 struct fpollinfo;
98 98
99 99 /*
100 100 * Poll list head structure. A pointer to this is passed to
101 101 * pollwakeup() from the caller indicating an event has occurred.
102 102 * Only the ph_list field is used, but for DDI compliance, we can't
103 103 * change the size of the structure.
104 104 */
105 105 typedef struct pollhead {
106 106 struct polldat *ph_list; /* list of pollers */
107 107 void *ph_pad1; /* unused -- see above */
108 108 short ph_pad2; /* unused -- see above */
109 109 } pollhead_t;
110 110
111 111 #if defined(_KERNEL)
112 112
113 113 /*
114 114 * Routine called to notify a process of the occurrence
115 115 * of an event.
116 116 */
117 117 extern void pollwakeup(pollhead_t *, short);
118 118
119 119 /*
120 120 * Internal routines.
121 121 */
122 122 extern void polllock(pollhead_t *, kmutex_t *);
123 123 extern int pollunlock(void);
124 124 extern void pollrelock(int);
125 125 extern void pollcleanup(void);
126 126 extern void pollblockexit(struct fpollinfo *);
127 127 extern void pollcacheclean(struct fpollinfo *, int);
128 128
129 129 /*
130 130 * public poll head interface:
↓ open down ↓ |
85 lines elided |
↑ open up ↑ |
131 131 *
132 132 * pollhead_clean clean up all polldats on a pollhead list
133 133 */
134 134 extern void pollhead_clean(pollhead_t *);
135 135
136 136 #endif /* defined(_KERNEL) */
137 137
138 138 #endif /* defined(_KERNEL) || defined(_KMEMUSER) */
139 139
140 140 #if !defined(_KERNEL)
141 -#if defined(__STDC__)
142 141 int poll(struct pollfd *, nfds_t, int);
143 -#else
144 -int poll();
145 -#endif /* __STDC__ */
146 142 #endif /* !_KERNEL */
147 143
148 144 #ifdef __cplusplus
149 145 }
150 146 #endif
151 147
152 148 #endif /* _SYS_POLL_H */
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX