LibC: Modify fd_set to be compatible with X/OPEN

For some reason X/OPEN requires that fd_set has a field fds_bits. Xproto
requires either fds_bits or _fds_bits to be present, so the field 'bits'
was renamed 'fds_bits'
This commit is contained in:
Peter Elliott 2021-07-22 23:43:17 -06:00 committed by Andreas Kling
parent 6f4324e64e
commit d9ecb3ecfa
Notes: sideshowbarker 2024-07-18 05:24:41 +09:00

View file

@ -8,12 +8,12 @@
#define FD_SETSIZE 1024
#define FD_ZERO(set) memset((set), 0, sizeof(fd_set));
#define FD_CLR(fd, set) ((set)->bits[(fd / 8)] &= ~(1 << (fd) % 8))
#define FD_SET(fd, set) ((set)->bits[(fd / 8)] |= (1 << (fd) % 8))
#define FD_ISSET(fd, set) ((set)->bits[(fd / 8)] & (1 << (fd) % 8))
#define FD_CLR(fd, set) ((set)->fds_bits[(fd / 8)] &= ~(1 << (fd) % 8))
#define FD_SET(fd, set) ((set)->fds_bits[(fd / 8)] |= (1 << (fd) % 8))
#define FD_ISSET(fd, set) ((set)->fds_bits[(fd / 8)] & (1 << (fd) % 8))
struct __fd_set {
unsigned char bits[FD_SETSIZE / 8];
unsigned char fds_bits[FD_SETSIZE / 8];
};
typedef struct __fd_set fd_set;