Print this page
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>


  30 #include <sys/param.h>
  31 #include <sys/types.h>
  32 #include <sys/sysmacros.h>
  33 #include <sys/systm.h>
  34 #include <sys/tuneable.h>
  35 #include <sys/errno.h>
  36 #include <sys/var.h>
  37 #include <sys/signal.h>
  38 #include <sys/time.h>
  39 #include <sys/sysconfig.h>
  40 #include <sys/resource.h>
  41 #include <sys/ulimit.h>
  42 #include <sys/unistd.h>
  43 #include <sys/debug.h>
  44 #include <sys/cpuvar.h>
  45 #include <sys/mman.h>
  46 #include <sys/timer.h>
  47 #include <sys/zone.h>
  48 #include <sys/vm_usage.h>
  49 


  50 long
  51 sysconfig(int which)
  52 {
  53         switch (which) {
  54 
  55         /*
  56          * if it is not handled in mach_sysconfig either
  57          * it must be EINVAL.
  58          */
  59         default:
  60                 return (mach_sysconfig(which)); /* `uname -i`/os */
  61 
  62         case _CONFIG_CLK_TCK:
  63                 return ((long)hz);      /* clock frequency per second */
  64 
  65         case _CONFIG_PROF_TCK:
  66                 return ((long)hz);      /* profiling clock freq per sec */
  67 
  68         case _CONFIG_NGROUPS:
  69                 /*


 123 
 124         case _CONFIG_DELAYTIMER_MAX:
 125                 return (INT_MAX);
 126 
 127         case _CONFIG_MQ_OPEN_MAX:
 128                 return (_MQ_OPEN_MAX);
 129 
 130         case _CONFIG_MQ_PRIO_MAX:
 131                 return (_MQ_PRIO_MAX);
 132 
 133         case _CONFIG_RTSIG_MAX:
 134                 return (_SIGRTMAX - _SIGRTMIN + 1);
 135 
 136         case _CONFIG_SEM_NSEMS_MAX:
 137                 return (_SEM_NSEMS_MAX);
 138 
 139         case _CONFIG_SEM_VALUE_MAX:
 140                 return (_SEM_VALUE_MAX);
 141 
 142         case _CONFIG_SIGQUEUE_MAX:
 143                 return (_SIGQUEUE_MAX);










 144 
 145         case _CONFIG_SIGRT_MIN:
 146                 return (_SIGRTMIN);
 147 
 148         case _CONFIG_SIGRT_MAX:
 149                 return (_SIGRTMAX);
 150 
 151         case _CONFIG_TIMER_MAX:
 152                 return (timer_max);
 153 
 154         case _CONFIG_PHYS_PAGES:
 155                 /*
 156                  * If the non-global zone has a phys. memory cap, use that.
 157                  * We always report the system-wide value for the global zone,
 158                  * even though rcapd can be used on the global zone too.
 159                  */
 160                 if (!INGLOBALZONE(curproc) &&
 161                     curproc->p_zone->zone_phys_mcap != 0)
 162                         return (MIN(btop(curproc->p_zone->zone_phys_mcap),
 163                             physinstalled));




  30 #include <sys/param.h>
  31 #include <sys/types.h>
  32 #include <sys/sysmacros.h>
  33 #include <sys/systm.h>
  34 #include <sys/tuneable.h>
  35 #include <sys/errno.h>
  36 #include <sys/var.h>
  37 #include <sys/signal.h>
  38 #include <sys/time.h>
  39 #include <sys/sysconfig.h>
  40 #include <sys/resource.h>
  41 #include <sys/ulimit.h>
  42 #include <sys/unistd.h>
  43 #include <sys/debug.h>
  44 #include <sys/cpuvar.h>
  45 #include <sys/mman.h>
  46 #include <sys/timer.h>
  47 #include <sys/zone.h>
  48 #include <sys/vm_usage.h>
  49 
  50 extern rctl_hndl_t rc_process_sigqueue;
  51 
  52 long
  53 sysconfig(int which)
  54 {
  55         switch (which) {
  56 
  57         /*
  58          * if it is not handled in mach_sysconfig either
  59          * it must be EINVAL.
  60          */
  61         default:
  62                 return (mach_sysconfig(which)); /* `uname -i`/os */
  63 
  64         case _CONFIG_CLK_TCK:
  65                 return ((long)hz);      /* clock frequency per second */
  66 
  67         case _CONFIG_PROF_TCK:
  68                 return ((long)hz);      /* profiling clock freq per sec */
  69 
  70         case _CONFIG_NGROUPS:
  71                 /*


 125 
 126         case _CONFIG_DELAYTIMER_MAX:
 127                 return (INT_MAX);
 128 
 129         case _CONFIG_MQ_OPEN_MAX:
 130                 return (_MQ_OPEN_MAX);
 131 
 132         case _CONFIG_MQ_PRIO_MAX:
 133                 return (_MQ_PRIO_MAX);
 134 
 135         case _CONFIG_RTSIG_MAX:
 136                 return (_SIGRTMAX - _SIGRTMIN + 1);
 137 
 138         case _CONFIG_SEM_NSEMS_MAX:
 139                 return (_SEM_NSEMS_MAX);
 140 
 141         case _CONFIG_SEM_VALUE_MAX:
 142                 return (_SEM_VALUE_MAX);
 143 
 144         case _CONFIG_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                 }
 156 
 157         case _CONFIG_SIGRT_MIN:
 158                 return (_SIGRTMIN);
 159 
 160         case _CONFIG_SIGRT_MAX:
 161                 return (_SIGRTMAX);
 162 
 163         case _CONFIG_TIMER_MAX:
 164                 return (timer_max);
 165 
 166         case _CONFIG_PHYS_PAGES:
 167                 /*
 168                  * If the non-global zone has a phys. memory cap, use that.
 169                  * We always report the system-wide value for the global zone,
 170                  * even though rcapd can be used on the global zone too.
 171                  */
 172                 if (!INGLOBALZONE(curproc) &&
 173                     curproc->p_zone->zone_phys_mcap != 0)
 174                         return (MIN(btop(curproc->p_zone->zone_phys_mcap),
 175                             physinstalled));