select()使用中对FD_SETSIZE考虑

/*
  malloc a fd_set on the heap, to make it dependent from FD_SETSIZE.
  make sure fd_count > FD_SETSIZE.
*/
#define NEW_FD_SET( fd_count ) \
        (struct fd_set*) malloc( sizeof( struct fd_set ) + sizeof( int ) * ( \
        fd_count - FD_SETSIZE > 0 ? fd_count - FD_SETSIZE : 0 ) )

原文地址:https://www.cnblogs.com/lxgeek/p/1950311.html