diff --git a/src/cdi_util.c b/src/cdi_util.c
index 2d69b4eb7e2e9bf0c105dec484467a3753fc7ecc..b821b3c79c6bc609c20c9915938fd7fe1b33fd46 100644
--- a/src/cdi_util.c
+++ b/src/cdi_util.c
@@ -2,6 +2,7 @@
 #include "config.h"
 #endif
 
+#include <unistd.h>
 #include <limits.h>
 #include <stdio.h>
 #include <stdlib.h>