diff --git a/libc/include/string.h b/libc/include/string.h index 4ca77ae0f..d67928c0f 100644 --- a/libc/include/string.h +++ b/libc/include/string.h @@ -31,7 +31,6 @@ #include #include -#include #include __BEGIN_DECLS diff --git a/libc/include/sys/select.h b/libc/include/sys/select.h index 553050bb6..0c4a823b6 100644 --- a/libc/include/sys/select.h +++ b/libc/include/sys/select.h @@ -31,7 +31,6 @@ #include #include -#include #include #include @@ -49,7 +48,14 @@ typedef struct { #define __FDMASK(fd) (1UL << ((fd) % NFDBITS)) #define __FDS_BITS(set) (((fd_set*)(set))->fds_bits) -#define FD_ZERO(set) (memset(set, 0, sizeof(*(fd_set*)(set)))) +/* Inline loop so we don't have to declare memset. */ +#define FD_ZERO(set) \ + do { \ + size_t __i; \ + for (__i = 0; __i < __FDSET_LONGS; ++__i) { \ + (set)->fds_bits[__i] = 0; \ + } \ + } while (0) extern void __FD_CLR_chk(int, fd_set*, size_t); extern void __FD_SET_chk(int, fd_set*, size_t);