http://bugs.gentoo.org/336649

--- a/src/main.c
+++ b/src/main.c
@@ -19,6 +19,7 @@
 
 #include <config.h>
 #include <sys/types.h>
+#include <sys/stat.h>
 #include <sys/wait.h>
 #include <stdarg.h>
 #include <errno.h>
