#ifdef IO_USE_SELECT
#include "defines.h" /* for conn.h */
-#include "conn.h" /* for CONN_IDX (needed by resolve.h) */
-#include "resolve.h" /* for RES_STAT (needed by conf.h) */
+#include "proc.h" /* for PROC_STAT (needed by conf.h) */
+#include "conn.h" /* for CONN_ID (needed by conf.h) */
#include "conf.h" /* for Conf_MaxConnections */
static fd_set readers;
return fcntl(fd, F_SETFL, flags) == 0;
}
+bool
+io_setcloexec(int fd)
+{
+ int flags = fcntl(fd, F_GETFD);
+ if (flags == -1)
+ return false;
+ flags |= FD_CLOEXEC;
+
+ return fcntl(fd, F_SETFD, flags) == 0;
+}
bool
io_close(int fd)