--- a/src/stream.c
+++ b/src/stream.c
@@ -81,6 +81,9 @@
 #include <netinet/in.h>
 #include <netinet/tcp.h>
 #include <arpa/inet.h>
+#ifndef _POSIX_SOURCE
+#define _POSIX_SOURCE
+#endif
 #include <netdb.h>
 #endif
 
