Print this page
3830 SIGQUEUE_MAX's limit of 32 is too low

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/os/sig.c
          +++ new/usr/src/uts/common/os/sig.c
↓ open down ↓ 2365 lines elided ↑ open up ↑
2366 2366                  case SI_QUEUE:
2367 2367                  case SI_TIMER:
2368 2368                  case SI_ASYNCIO:
2369 2369                  case SI_MESGQ:
2370 2370                          return (1);
2371 2371                  }
2372 2372          }
2373 2373          return (0);
2374 2374  }
2375 2375  
2376      -#ifndef UCHAR_MAX
2377      -#define UCHAR_MAX       255
     2376 +#ifndef INT_MAX
     2377 +#define INT_MAX 2147483647
2378 2378  #endif
2379 2379  
2380 2380  /*
2381 2381   * The entire pool (with maxcount entries) is pre-allocated at
2382 2382   * the first sigqueue/signotify call.
2383 2383   */
2384 2384  sigqhdr_t *
2385 2385  sigqhdralloc(size_t size, uint_t maxcount)
2386 2386  {
2387 2387          size_t i;
2388 2388          sigqueue_t *sq, *next;
2389 2389          sigqhdr_t *sqh;
2390 2390  
2391 2391          i = (maxcount * size) + sizeof (sigqhdr_t);
2392      -        ASSERT(maxcount <= UCHAR_MAX && i <= USHRT_MAX);
     2392 +        ASSERT(maxcount <= INT_MAX);
2393 2393          sqh = kmem_alloc(i, KM_SLEEP);
2394      -        sqh->sqb_count = (uchar_t)maxcount;
2395      -        sqh->sqb_maxcount = (uchar_t)maxcount;
2396      -        sqh->sqb_size = (ushort_t)i;
     2394 +        sqh->sqb_count = maxcount;
     2395 +        sqh->sqb_maxcount = maxcount;
     2396 +        sqh->sqb_size = i;
2397 2397          sqh->sqb_pexited = 0;
2398 2398          sqh->sqb_sent = 0;
2399 2399          sqh->sqb_free = sq = (sigqueue_t *)(sqh + 1);
2400 2400          for (i = maxcount - 1; i != 0; i--) {
2401 2401                  next = (sigqueue_t *)((uintptr_t)sq + size);
2402 2402                  sq->sq_next = next;
2403 2403                  sq = next;
2404 2404          }
2405 2405          sq->sq_next = NULL;
2406 2406          cv_init(&sqh->sqb_cv, NULL, CV_DEFAULT, NULL);
↓ open down ↓ 457 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX