1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 06:17:35 +00:00

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

View file

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