diff --git a/contrib/pg_autovacuum/pg_autovacuum.h b/contrib/pg_autovacuum/pg_autovacuum.h
index 63a31965361d0099a15ac2b821c2054750e0863b..ac97f63bec0515da64de5b1937170b141d086776 100644
--- a/contrib/pg_autovacuum/pg_autovacuum.h
+++ b/contrib/pg_autovacuum/pg_autovacuum.h
@@ -9,6 +9,7 @@
 #ifdef __GLIBC__
 #include <getopt.h>
 #endif
+#include <time.h>
 #include <sys/time.h>
 
 /* These next two lines are correct when pg_autovaccum is compiled