diff a/src/rrd_tool.c b/src/rrd_tool.c
--- a/src/rrd_tool.c
+++ b/src/rrd_tool.c
@@ -12,6 +12,8 @@
 #endif
 #endif
 
+#include <unistd.h>
+
 #include "rrd_tool.h"
 #include "rrd_xport.h"
 #include "rrd_i18n.h"
