// * fd_set实现 // * fd_set中保存了位的数组,每一位的索引就是对应的文件描述字。 // 该位为1代表对应的文件描述字在fd_set中;为0则相反。 // * 位数组的实现依靠一个_FdBitsUnit类型的数组, // _FdbitsUnit是一种内置整型(在这里我们将它指定为机器字长), // _FdbitsUnit能存储_bitCountOfFdBitsUnit个位; // 显而易见,该数组的元素个数为FD_SETSIZE / _bitCountOfFdBitsUnit。 // * _FdBitsUnit实现 typedef unsigned int _FdBitsUnit; // * _FdBitsUnit所能容纳的位数 const int _bitCountOfFdBitsUnit = CHAR_BIT * (int)sizeof(_FdBitsUnit); // * [POSIX]fd_set typedef struct { // PRIVATE _FdBitsUnit _fdBits[FD_SETSIZE / _bitCountOfFdBitsUnit]; }fd_set; // * [POSIX]FD_SET #define FD_SET(fd, fdset) \ ((void)(fdset)->_fdBits[(fd / _bitCountOfFdBitsUnit)] |= (_FdBitsUnit)((unsigned)1 << (fd % _bitCountOfFdBitsUnit))) // * [POSIX]FD_CLR #define FD_CLR(fd, fdset) \ ((void)(fdset)->_fdBits[(fd / _bitCountOfFdBitsUnit)] &= ~(_FdBitsUnit)((unsigned)1 << (fd % _bitCountOfFdBitsUnit))) // * [POSIX]FD_ISSET #define FD_ISSET(fd, fdset) \ ((fdset)->_fdBits[(fd / _bitCountOfFdBitsUnit)] & (_FdBitsUnit)((unsigned)1 << (fd % _bitCountOfFdBitsUnit)) == 0) // * [POSIX]FD_ZERO #define FD_ZERO(fdset) \ memset(fdset->_fdBits, 0, sizeof _fdBits * sizeof _fdBits[0]) // * [POSIX]select int select( int nfds, // 等待检查的最大套接字 fd_set *readfds, // 指向一组等待可读性检查的套接字 fd_set *writefds, // 指向一组等待可写性检查的套接字 fd_set *exceptfd, // 指向一组等待错误检查的套接字 const struct timeval *timeout // 最多等待时间 );
相关推荐
POSIX平台多线程编程指南 通用开放式操作系统的多线程应用指南。
pthread编程指南,介绍关于PTHREAD的编程,在Linux下的应用。。
Micrium port for Linux POSIX
IEEE standard document
首先,在Linux内核中,select所用到的FD_SET是有限的,即内核中有个参数__FD_SETSIZE定义了每个FD_SET的句柄个数,在我用的2.6.15-25-386内核中,该值是1024,搜索内核源代码得到: include/linux/posix_types.h: ...
posix vlc ram program
符合posix规范的跨平台编程指导书;适合底层开发,linux开发;windows对posix支持不是太好
Block driver for RAW files (posix).
MingW-x86_64-8.1.0-release-posix-seh-rt_v6-rev0
分享Linux下的多线程编程中的整理必备资料
POSIX规范,或者IEEE Std 1003.1, 2004 Edition,unix的标准系统定义
The Time routines in this file use standard POSIX routines for Linux.
Called as a performance hint when the Surface is allowed to make it s contents undefined.
Test that we do not crash.
We stash a pointer to the block header, just before the allocated space, so that we can decrement the live count on delete in constant time.
Efika 5K2 platform code Some code really inspired the lite5200b platform.
Threads compatibility routines for libgcc2 and libobjc. Compile this one with gcc.
linux下的pthread(线程包),网上不好找,所以放到这里共享了
mysql关于时区的插件,解决django集成celery时的报错