diff --git a/configure.ac b/configure.ac
index 2e8d4ccef..3c487e9f8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -263,7 +263,7 @@ AC_SEARCH_LIBS( nanosleep, rt, , [AC_MSG_ERROR([Cannot find the rt library, need
 AC_SEARCH_LIBS( setupterm, [ncurses curses], , [AC_MSG_ERROR([Could not find a curses implementation, needed to build fish])] )
 
 # Check for presense of various header files
-AC_CHECK_HEADERS([getopt.h termio.h sys/resource.h term.h ncurses/term.h libintl.h ncurses.h curses.h stropts.h siginfo.h])
+AC_CHECK_HEADERS([getopt.h termio.h sys/resource.h term.h ncurses/term.h libintl.h ncurses.h curses.h stropts.h siginfo.h sys/select.h])
 
 AC_CHECK_HEADER([regex.h],
 				[AC_DEFINE([HAVE_REGEX_H], [1], [Define to 1 if you have the <regex.h> header file.])],
diff --git a/env_universal.c b/env_universal.c
index 55f0b6268..8ac534513 100644
--- a/env_universal.c
+++ b/env_universal.c
@@ -25,6 +25,10 @@
 #include <ncurses/term.h>
 #endif
 
+#ifdef HAVE_SYS_SELECT_H
+#include <sys/select.h>
+#endif
+
 #include <signal.h>
 
 #include "fallback.h"
diff --git a/env_universal_common.c b/env_universal_common.c
index 8c9dd55eb..475b80a8a 100644
--- a/env_universal_common.c
+++ b/env_universal_common.c
@@ -28,6 +28,10 @@
 #include <signal.h>
 #include <sys/stat.h>
 
+#ifdef HAVE_SYS_SELECT_H
+#include <sys/select.h>
+#endif
+
 #include "fallback.h"
 #include "util.h"
 
diff --git a/proc.c b/proc.c
index e622a6070..b76fd0698 100644
--- a/proc.c
+++ b/proc.c
@@ -46,6 +46,10 @@ Some of the code in this file is based on code from the Glibc manual.
 #include <siginfo.h>
 #endif
 
+#ifdef HAVE_SYS_SELECT_H
+#include <sys/select.h>
+#endif
+
 #include "fallback.h"
 #include "util.h"
 
diff --git a/reader.c b/reader.c
index a50fce9c3..5cbb1f5e2 100644
--- a/reader.c
+++ b/reader.c
@@ -55,6 +55,10 @@ commence.
 #include <siginfo.h>
 #endif
 
+#ifdef HAVE_SYS_SELECT_H
+#include <sys/select.h>
+#endif
+
 #include <signal.h>
 #include <fcntl.h>
 #include <dirent.h>