diff --git a/tools/gpio/gpio-event-mon.c b/tools/gpio/gpio-event-mon.c
index be6768e21b09126927fc3527f5aaaa1d4bd075e9..dac4d4131d9b250cec8d724bc919a58da554ab61 100644
--- a/tools/gpio/gpio-event-mon.c
+++ b/tools/gpio/gpio-event-mon.c
@@ -24,6 +24,7 @@
 #include <getopt.h>
 #include <inttypes.h>
 #include <sys/ioctl.h>
+#include <sys/types.h>
 #include <linux/gpio.h>
 
 int monitor_device(const char *device_name,