summaryrefslogtreecommitdiff
path: root/usr/src/uts/common/syscall/sigqueue.c
diff options
context:
space:
mode:
authorDavid Höppner <0xffea@gmail.com>2013-06-24 12:51:44 +0000
committerRichard Lowe <richlowe@richlowe.net>2013-09-27 11:24:30 -0400
commit5e989a96186a37eb528fb7bb4d28a150874ec799 (patch)
treeb14e350ba6c6f641c97c0015997076bf4d67f28f /usr/src/uts/common/syscall/sigqueue.c
parentb9476f453004695da12eaaff383ed9005e7a47c4 (diff)
downloadillumos-joyent-5e989a96186a37eb528fb7bb4d28a150874ec799.tar.gz
3830 SIGQUEUE_MAX's limit of 32 is too low
Reviewed by: Cedric Blancher <cedric.blancher@gmail.com> Reviewed by: John Kennedy <john.kennedy@delphix.com> Reviewed by: Irek Szczesniak <iszczesniak@gmail.com> Approved by: Richard Lowe <richlowe@richlowe.net>
Diffstat (limited to 'usr/src/uts/common/syscall/sigqueue.c')
-rw-r--r--usr/src/uts/common/syscall/sigqueue.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/usr/src/uts/common/syscall/sigqueue.c b/usr/src/uts/common/syscall/sigqueue.c
index cb38bafbd9..9f4eb67f79 100644
--- a/usr/src/uts/common/syscall/sigqueue.c
+++ b/usr/src/uts/common/syscall/sigqueue.c
@@ -26,8 +26,6 @@
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include <sys/param.h>
#include <sys/types.h>
#include <sys/sysmacros.h>
@@ -40,6 +38,8 @@
#include <sys/siginfo.h>
#include <sys/debug.h>
+extern rctl_hndl_t rc_process_sigqueue;
+
static int
sigqkill(pid_t pid, sigsend_t *sigsend)
{
@@ -121,7 +121,7 @@ kill(pid_t pid, int sig)
*/
int
sigqueue(pid_t pid, int sig, /* union sigval */ void *value,
- int si_code, int block)
+ int si_code, int block)
{
int error;
sigsend_t v;
@@ -133,8 +133,15 @@ sigqueue(pid_t pid, int sig, /* union sigval */ void *value,
return (set_errno(EINVAL));
if ((sqh = p->p_sigqhdr) == NULL) {
+ rlim64_t sigqsz_max;
+
+ mutex_enter(&p->p_lock);
+ sigqsz_max = rctl_enforced_value(rc_process_sigqueue,
+ p->p_rctls, p);
+ mutex_exit(&p->p_lock);
+
/* Allocate sigqueue pool first time */
- sqh = sigqhdralloc(sizeof (sigqueue_t), _SIGQUEUE_MAX);
+ sqh = sigqhdralloc(sizeof (sigqueue_t), (uint_t)sigqsz_max);
mutex_enter(&p->p_lock);
if (p->p_sigqhdr == NULL) {
/* hang the pool head on proc */