Index: src/redhttp/test_redhttpd.c
--- src/redhttp/test_redhttpd.c.orig	2010-02-15 00:13:29.000000000 +0100
+++ src/redhttp/test_redhttpd.c	2010-04-03 10:22:27.000000000 +0200
@@ -16,13 +16,17 @@
     along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
+#ifndef __FreeBSD__
 #define _POSIX_C_SOURCE 1
+#endif
 
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
 #include <string.h>
 #include <getopt.h>
+#include <sys/types.h>
+#include <sys/socket.h>
 
 #include "redhttp.h"
 
Index: src/redstore.c
--- src/redstore.c.orig	2010-02-15 00:13:30.000000000 +0100
+++ src/redstore.c	2010-04-03 10:22:52.000000000 +0200
@@ -16,7 +16,9 @@
     along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
+#ifndef __FreeBSD__
 #define _POSIX_C_SOURCE 1
+#endif
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -26,6 +28,8 @@
 #include <time.h>
 #include <unistd.h>
 #include <getopt.h>
+#include <sys/types.h>
+#include <sys/socket.h>
 
 #include "redstore.h"
 
