#ifndef _YGGDRASIL_SYS_SELECT_H
#define _YGGDRASIL_SYS_SELECT_H 1

#define FD_CLR(fd, fd_set) \
    (fd_set).__bits[(fd) / FD_BITS_PER_WORD] &= ~(1 << ((fd) % FD_BITS_PER_WORD))

#define FD_ISSET(fd, fd_set) \
    (!!((fd_set).__bits[(fd) / FD_BITS_PER_WORD] & (1 << ((fd) % FD_BITS_PER_WORD))))

#define FD_SET(fd, fd_set) \
    (fd_set).__bits[(fd) / FD_BITS_PER_WORD] |= (1 << ((fd) % FD_BITS_PER_WORD))

#define FD_ZERO(fd_set) \
    (fd_set).__bits = {0}

#endif
