diff --git a/scd/app.c b/scd/app.c
index 21230bd..5999c37 100644
--- a/scd/app.c
+++ b/scd/app.c
@@ -23,6 +23,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <npth.h>
+#include <unistd.h>
 
 #ifndef HAVE_W32_SYSTEM
 #include <fcntl.h>		/* F_SETFD F_GETFL F_SETFL O_NONBLOCK fcntl(2) */
