select中fd_set数据结构解析

/ 默认分类 / 0 条评论 / 3浏览

先来看下fd_set的数据结构源码

#define __FD_SETSIZE 1024

typedef struct {
    unsigned long fds_bits[__FD_SETSIZE / (8 * sizeof(unsigned long))];
} fd_set;