include unistd.h for getopt()
diff --git a/hd.c b/hd.c
index 1f7d179..959d1f7 100644
--- a/hd.c
+++ b/hd.c
@@ -5,6 +5,7 @@
 #include <fcntl.h>
 #include <sys/ioctl.h>
 #include <errno.h>
+#include <unistd.h>
 
 int hd_main(int argc, char *argv[])
 {