Print this page
3830 SIGQUEUE_MAX's limit of 32 is too low
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/uts/common/syscall/sysconfig.c
+++ new/usr/src/uts/common/syscall/sysconfig.c
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 2008 Sun Microsystems, Inc. All rights reserved.
24 24 * Use is subject to license terms.
25 25 */
26 26
27 27 /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
28 28 /* All Rights Reserved */
29 29
30 30 #include <sys/param.h>
31 31 #include <sys/types.h>
32 32 #include <sys/sysmacros.h>
33 33 #include <sys/systm.h>
34 34 #include <sys/tuneable.h>
35 35 #include <sys/errno.h>
36 36 #include <sys/var.h>
37 37 #include <sys/signal.h>
38 38 #include <sys/time.h>
39 39 #include <sys/sysconfig.h>
↓ open down ↓ |
39 lines elided |
↑ open up ↑ |
40 40 #include <sys/resource.h>
41 41 #include <sys/ulimit.h>
42 42 #include <sys/unistd.h>
43 43 #include <sys/debug.h>
44 44 #include <sys/cpuvar.h>
45 45 #include <sys/mman.h>
46 46 #include <sys/timer.h>
47 47 #include <sys/zone.h>
48 48 #include <sys/vm_usage.h>
49 49
50 +extern rctl_hndl_t rc_process_sigqueue;
51 +
50 52 long
51 53 sysconfig(int which)
52 54 {
53 55 switch (which) {
54 56
55 57 /*
56 58 * if it is not handled in mach_sysconfig either
57 59 * it must be EINVAL.
58 60 */
59 61 default:
60 62 return (mach_sysconfig(which)); /* `uname -i`/os */
61 63
62 64 case _CONFIG_CLK_TCK:
63 65 return ((long)hz); /* clock frequency per second */
64 66
65 67 case _CONFIG_PROF_TCK:
66 68 return ((long)hz); /* profiling clock freq per sec */
67 69
68 70 case _CONFIG_NGROUPS:
69 71 /*
70 72 * Maximum number of supplementary groups.
71 73 */
72 74 return (ngroups_max);
73 75
74 76 case _CONFIG_OPEN_FILES:
75 77 /*
76 78 * Maximum number of open files (soft limit).
77 79 */
78 80 {
79 81 rlim64_t fd_ctl;
80 82 mutex_enter(&curproc->p_lock);
81 83 fd_ctl = rctl_enforced_value(
82 84 rctlproc_legacy[RLIMIT_NOFILE], curproc->p_rctls,
83 85 curproc);
84 86 mutex_exit(&curproc->p_lock);
85 87 return ((ulong_t)fd_ctl);
86 88 }
87 89
88 90 case _CONFIG_CHILD_MAX:
89 91 /*
90 92 * Maximum number of processes.
91 93 */
92 94 return (v.v_maxup);
93 95
94 96 case _CONFIG_POSIX_VER:
95 97 return (_POSIX_VERSION); /* current POSIX version */
96 98
97 99 case _CONFIG_PAGESIZE:
98 100 return (PAGESIZE);
99 101
100 102 case _CONFIG_XOPEN_VER:
101 103 return (_XOPEN_VERSION); /* current XOPEN version */
102 104
103 105 case _CONFIG_NPROC_CONF:
104 106 return (zone_ncpus_get(curproc->p_zone));
105 107
106 108 case _CONFIG_NPROC_ONLN:
107 109 return (zone_ncpus_online_get(curproc->p_zone));
108 110
109 111 case _CONFIG_NPROC_MAX:
110 112 return (max_ncpus);
111 113
112 114 case _CONFIG_STACK_PROT:
113 115 return (curproc->p_stkprot & ~PROT_USER);
114 116
115 117 case _CONFIG_AIO_LISTIO_MAX:
116 118 return (_AIO_LISTIO_MAX);
117 119
118 120 case _CONFIG_AIO_MAX:
119 121 return (_AIO_MAX);
120 122
121 123 case _CONFIG_AIO_PRIO_DELTA_MAX:
122 124 return (0);
123 125
124 126 case _CONFIG_DELAYTIMER_MAX:
125 127 return (INT_MAX);
126 128
127 129 case _CONFIG_MQ_OPEN_MAX:
128 130 return (_MQ_OPEN_MAX);
129 131
130 132 case _CONFIG_MQ_PRIO_MAX:
131 133 return (_MQ_PRIO_MAX);
132 134
↓ open down ↓ |
73 lines elided |
↑ open up ↑ |
133 135 case _CONFIG_RTSIG_MAX:
134 136 return (_SIGRTMAX - _SIGRTMIN + 1);
135 137
136 138 case _CONFIG_SEM_NSEMS_MAX:
137 139 return (_SEM_NSEMS_MAX);
138 140
139 141 case _CONFIG_SEM_VALUE_MAX:
140 142 return (_SEM_VALUE_MAX);
141 143
142 144 case _CONFIG_SIGQUEUE_MAX:
143 - return (_SIGQUEUE_MAX);
145 + /*
146 + * Maximum number of outstanding queued signals.
147 + */
148 + {
149 + rlim64_t sigqsz_max;
150 + mutex_enter(&curproc->p_lock);
151 + sigqsz_max = rctl_enforced_value(rc_process_sigqueue,
152 + curproc->p_rctls, curproc);
153 + mutex_exit(&curproc->p_lock);
154 + return ((uint_t)sigqsz_max);
155 + }
144 156
145 157 case _CONFIG_SIGRT_MIN:
146 158 return (_SIGRTMIN);
147 159
148 160 case _CONFIG_SIGRT_MAX:
149 161 return (_SIGRTMAX);
150 162
151 163 case _CONFIG_TIMER_MAX:
152 164 return (timer_max);
153 165
154 166 case _CONFIG_PHYS_PAGES:
155 167 /*
156 168 * If the non-global zone has a phys. memory cap, use that.
157 169 * We always report the system-wide value for the global zone,
158 170 * even though rcapd can be used on the global zone too.
159 171 */
160 172 if (!INGLOBALZONE(curproc) &&
161 173 curproc->p_zone->zone_phys_mcap != 0)
162 174 return (MIN(btop(curproc->p_zone->zone_phys_mcap),
163 175 physinstalled));
164 176
165 177 return (physinstalled);
166 178
167 179 case _CONFIG_AVPHYS_PAGES:
168 180 /*
169 181 * If the non-global zone has a phys. memory cap, use
170 182 * the phys. memory cap - zone's current rss. We always
171 183 * report the system-wide value for the global zone, even
172 184 * though rcapd can be used on the global zone too.
173 185 */
174 186 if (!INGLOBALZONE(curproc) &&
175 187 curproc->p_zone->zone_phys_mcap != 0) {
176 188 pgcnt_t cap, rss, free;
177 189 vmusage_t in_use;
178 190 size_t cnt = 1;
179 191
180 192 cap = btop(curproc->p_zone->zone_phys_mcap);
181 193 if (cap > physinstalled)
182 194 return (freemem);
183 195
184 196 if (vm_getusage(VMUSAGE_ZONE, 1, &in_use, &cnt,
185 197 FKIOCTL) != 0)
186 198 in_use.vmu_rss_all = 0;
187 199 rss = btop(in_use.vmu_rss_all);
188 200 /*
189 201 * Because rcapd implements a soft cap, it is possible
190 202 * for rss to be temporarily over the cap.
191 203 */
192 204 if (cap > rss)
193 205 free = cap - rss;
194 206 else
195 207 free = 0;
196 208 return (MIN(free, freemem));
197 209 }
198 210
199 211 return (freemem);
200 212
201 213 case _CONFIG_MAXPID:
202 214 return (maxpid);
203 215
204 216 case _CONFIG_CPUID_MAX:
205 217 return (max_cpuid);
206 218
207 219 case _CONFIG_EPHID_MAX:
208 220 return (MAXEPHUID);
209 221
210 222 case _CONFIG_SYMLOOP_MAX:
211 223 return (MAXSYMLINKS);
212 224 }
213 225 }
↓ open down ↓ |
60 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX