Print this page
libc: only have one select implementation, and move the pollfds onto the heap if they cross some threshold

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/sys/select.h
          +++ new/usr/src/uts/common/sys/select.h
↓ open down ↓ 70 lines elided ↑ open up ↑
  71   71          unsigned int    __sigbits[4];
  72   72  } sigset_t;
  73   73  #endif  /* _SIGSET_T */
  74   74  
  75   75  #endif /* #if !defined(__XOPEN_OR_POSIX) || defined(_XPG6) ... */
  76   76  
  77   77  /*
  78   78   * Select uses bit masks of file descriptors in longs.
  79   79   * These macros manipulate such bit fields.
  80   80   * FD_SETSIZE may be defined by the user, but the default here
  81      - * should be >= NOFILE (param.h).
       81 + * should be >= RLIM_FD_MAX.
  82   82   */
  83   83  #ifndef FD_SETSIZE
  84      -#ifdef _LP64
  85   84  #define FD_SETSIZE      65536
  86      -#else
  87      -#define FD_SETSIZE      1024
  88      -#endif  /* _LP64 */
  89      -#elif FD_SETSIZE > 1024 && !defined(_LP64)
  90      -#ifdef __PRAGMA_REDEFINE_EXTNAME
  91      -#pragma redefine_extname        select  select_large_fdset
  92      -#if !defined(__XOPEN_OR_POSIX) || defined(_XPG6) || defined(__EXTENSIONS__)
  93      -#pragma redefine_extname        pselect pselect_large_fdset
  94      -#endif
  95      -#else   /* __PRAGMA_REDEFINE_EXTNAME */
  96      -#define select  select_large_fdset
  97      -#if !defined(__XOPEN_OR_POSIX) || defined(_XPG6) || defined(__EXTENSIONS__)
  98      -#define pselect pselect_large_fdset
  99      -#endif
 100      -#endif  /* __PRAGMA_REDEFINE_EXTNAME */
 101   85  #endif  /* FD_SETSIZE */
 102   86  
 103   87  #if !defined(_XPG4_2) || defined(__EXTENSIONS__)
 104   88  typedef long    fd_mask;
 105   89  #endif
 106   90  typedef long    fds_mask;
 107   91  
 108   92  /*
 109   93   *  The value of _NBBY needs to be consistant with the value
 110   94   *  of NBBY in <sys/param.h>.
↓ open down ↓ 67 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX