chiark / gitweb /
fds: Simplify fd close condition in tun_set_route
[secnet.git] / secnet.h
index 194341c434670902e772b58a956fbfbe6fd4b050..ce01d24e31749e1bb8a00db3444f1c5cb449bcab 100644 (file)
--- a/secnet.h
+++ b/secnet.h
@@ -9,6 +9,8 @@
 #include <stdio.h>
 #include <string.h>
 #include <assert.h>
+#include <fcntl.h>
+#include <unistd.h>
 #include <sys/poll.h>
 #include <sys/types.h>
 #include <sys/time.h>
@@ -136,6 +138,8 @@ extern char *safe_strdup(const char *string, const char *message);
 extern void *safe_malloc(size_t size, const char *message);
 extern void *safe_malloc_ary(size_t size, size_t count, const char *message);
 
+void setcloexec(int fd); /* cannot fail */
+
 extern int sys_cmd(const char *file, const char *argc, ...);
 
 extern uint64_t now_global;