include unistd.h for getopt.
diff --git a/cmp.c b/cmp.c
index 9bd2e19..4d40518 100644
--- a/cmp.c
+++ b/cmp.c
@@ -5,6 +5,7 @@
 #include <fcntl.h>
 #include <sys/ioctl.h>
 #include <errno.h>
+#include <unistd.h>
 
 int cmp_main(int argc, char *argv[])
 {