Print this page
3772 consider raising default descriptor soft limit
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/uts/common/sys/select.h
+++ new/usr/src/uts/common/sys/select.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 (the "License").
6 6 * You may not use this file except in compliance with the License.
7 7 *
8 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 * or http://www.opensolaris.org/os/licensing.
10 10 * See the License for the specific language governing permissions
11 11 * and limitations under the License.
12 12 *
13 13 * When distributing Covered Code, include this CDDL HEADER in each
14 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 15 * If applicable, add the following below this CDDL HEADER, with the
16 16 * fields enclosed by brackets "[]" replaced with your own identifying
17 17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 18 *
19 19 * CDDL HEADER END
20 20 */
21 21
22 22 /*
23 23 * Copyright 2014 Garrett D'Amore <garrett@damore.org>
24 24 *
25 25 * Copyright 2013 Nexenta Systems, Inc. All rights reserved.
26 26 *
27 27 * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
28 28 * Use is subject to license terms.
29 29 */
30 30
31 31 /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
32 32 /* All Rights Reserved */
33 33
34 34 /*
35 35 * University Copyright- Copyright (c) 1982, 1986, 1988
36 36 * The Regents of the University of California
37 37 * All Rights Reserved
38 38 *
39 39 * University Acknowledgment- Portions of this document are derived from
40 40 * software developed by the University of California, Berkeley, and its
41 41 * contributors.
42 42 */
43 43
44 44 #ifndef _SYS_SELECT_H
45 45 #define _SYS_SELECT_H
46 46
47 47 #include <sys/feature_tests.h>
48 48
49 49 #if !defined(_KERNEL) && !defined(_FAKE_KERNEL)
50 50 #if !defined(__XOPEN_OR_POSIX) || defined(_XPG6) || defined(__EXTENSIONS__)
51 51 #include <sys/time_impl.h>
52 52 #endif
53 53 #include <sys/time.h>
54 54 #endif /* !_KERNEL */
55 55
56 56 #ifdef __cplusplus
57 57 extern "C" {
58 58 #endif
59 59
60 60
61 61 #if !defined(__XOPEN_OR_POSIX) || defined(_XPG6) || defined(__EXTENSIONS__)
62 62 /*
63 63 * The sigset_t type is defined in <sys/signal.h> and duplicated
64 64 * in <sys/ucontext.h> as a result of XPG4v2 requirements. XPG6
65 65 * now allows the visibility of signal.h in this header, however
66 66 * an order of inclusion problem occurs as a result of inclusion
67 67 * of <sys/select.h> in <signal.h> under certain conditions.
68 68 * Rather than include <sys/signal.h> here, we've duplicated
69 69 * the sigset_t type instead. This type is required for the XPG6
70 70 * introduced pselect() function also declared in this header.
71 71 */
72 72 #ifndef _SIGSET_T
73 73 #define _SIGSET_T
74 74 typedef struct { /* signal set type */
↓ open down ↓ |
74 lines elided |
↑ open up ↑ |
75 75 unsigned int __sigbits[4];
76 76 } sigset_t;
77 77 #endif /* _SIGSET_T */
78 78
79 79 #endif /* #if !defined(__XOPEN_OR_POSIX) || defined(_XPG6) ... */
80 80
81 81 /*
82 82 * Select uses bit masks of file descriptors in longs.
83 83 * These macros manipulate such bit fields.
84 84 * FD_SETSIZE may be defined by the user, but the default here
85 - * should be >= NOFILE (param.h).
85 + * should be >= RLIM_FD_MAX.
86 86 */
87 87 #ifndef FD_SETSIZE
88 -#ifdef _LP64
89 88 #define FD_SETSIZE 65536
90 -#else
91 -#define FD_SETSIZE 1024
92 -#endif /* _LP64 */
93 -#elif FD_SETSIZE > 1024 && !defined(_LP64)
94 -#ifdef __PRAGMA_REDEFINE_EXTNAME
95 -#pragma redefine_extname select select_large_fdset
96 -#if !defined(__XOPEN_OR_POSIX) || defined(_XPG6) || defined(__EXTENSIONS__)
97 -#pragma redefine_extname pselect pselect_large_fdset
98 -#endif
99 -#else /* __PRAGMA_REDEFINE_EXTNAME */
100 -#define select select_large_fdset
101 -#if !defined(__XOPEN_OR_POSIX) || defined(_XPG6) || defined(__EXTENSIONS__)
102 -#define pselect pselect_large_fdset
103 -#endif
104 -#endif /* __PRAGMA_REDEFINE_EXTNAME */
105 89 #endif /* FD_SETSIZE */
106 90
107 91 #if !defined(_XPG4_2) || defined(__EXTENSIONS__)
108 92 typedef long fd_mask;
109 93 #endif
110 94 typedef long fds_mask;
111 95
112 96 /*
113 97 * The value of _NBBY needs to be consistant with the value
114 98 * of NBBY in <sys/param.h>.
115 99 */
116 100 #define _NBBY 8
117 101 #if !defined(_XPG4_2) || defined(__EXTENSIONS__)
118 102 #ifndef NBBY /* number of bits per byte */
119 103 #define NBBY _NBBY
120 104 #endif
121 105 #endif /* !defined(_XPG4_2) || defined(__EXTENSIONS__) */
122 106
123 107 #if !defined(_XPG4_2) || defined(__EXTENSIONS__)
124 108 #define NFDBITS (sizeof (fd_mask) * NBBY) /* bits per mask */
125 109 #endif
126 110 #define FD_NFDBITS (sizeof (fds_mask) * _NBBY) /* bits per mask */
127 111
128 112 #define __howmany(__x, __y) (((__x)+((__y)-1))/(__y))
129 113 #if !defined(_XPG4_2) || defined(__EXTENSIONS__)
130 114 #ifndef howmany
131 115 #define howmany(x, y) (((x)+((y)-1))/(y))
132 116 #endif
133 117 #endif /* !defined(_XPG4_2) || defined(__EXTENSIONS__) */
134 118
135 119 #if !defined(_XPG4_2) || defined(__EXTENSIONS__)
136 120 typedef struct fd_set {
137 121 #else
138 122 typedef struct __fd_set {
139 123 #endif
140 124 long fds_bits[__howmany(FD_SETSIZE, FD_NFDBITS)];
141 125 } fd_set;
142 126
143 127 #define FD_SET(__n, __p) ((__p)->fds_bits[(__n)/FD_NFDBITS] |= \
144 128 (1ul << ((__n) % FD_NFDBITS)))
145 129
146 130 #define FD_CLR(__n, __p) ((__p)->fds_bits[(__n)/FD_NFDBITS] &= \
147 131 ~(1ul << ((__n) % FD_NFDBITS)))
148 132
149 133 #define FD_ISSET(__n, __p) (((__p)->fds_bits[(__n)/FD_NFDBITS] & \
150 134 (1ul << ((__n) % FD_NFDBITS))) != 0l)
151 135
152 136 #if defined(_KERNEL) || defined(_FAKE_KERNEL)
153 137 #define FD_ZERO(p) bzero((p), sizeof (*(p)))
154 138 #else
155 139 #define FD_ZERO(__p) (void) memset((__p), 0, sizeof (*(__p)))
156 140 #endif /* _KERNEL */
157 141
158 142 #if !defined(_KERNEL) && !defined(_FAKE_KERNEL)
159 143 extern int select(int, fd_set *_RESTRICT_KYWD, fd_set *_RESTRICT_KYWD,
160 144 fd_set *_RESTRICT_KYWD, struct timeval *_RESTRICT_KYWD);
161 145
162 146 #if !defined(__XOPEN_OR_POSIX) || defined(_XPG6) || defined(__EXTENSIONS__)
163 147 extern int pselect(int, fd_set *_RESTRICT_KYWD, fd_set *_RESTRICT_KYWD,
164 148 fd_set *_RESTRICT_KYWD, const struct timespec *_RESTRICT_KYWD,
165 149 const sigset_t *_RESTRICT_KYWD);
166 150 #endif
167 151
168 152 #endif /* _KERNEL */
169 153
170 154 #ifdef __cplusplus
171 155 }
172 156 #endif
173 157
174 158 #endif /* _SYS_SELECT_H */
↓ open down ↓ |
60 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX