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 ) )



你可能感兴趣的:(select)