configure: add SCHED_IDLE check

We can't consider it always available on Linux. It fails on
Debian 6.x, for instance.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
diff --git a/configure b/configure
index 583e3ab..995b5df 100755
--- a/configure
+++ b/configure
@@ -200,6 +200,7 @@
   output_sym "CONFIG_FDATASYNC"
   output_sym "CONFIG_GETTIMEOFDAY"
   output_sym "CONFIG_CLOCK_GETTIME"
+  output_sym "CONFIG_SCHED_IDLE"
   echo "CC=$CC" >> $config_host_mak
   echo "EXTFLAGS=$CFLAGS -include config-host.h -D_GNU_SOURCE" >> $config_host_mak
   exit 0
@@ -844,6 +845,22 @@
 fi
 echo "RUSAGE_THREAD                 $rusage_thread"
 
+##########################################
+# Check whether we have SCHED_IDLE
+sched_idle="no"
+cat > $TMPC << EOF
+#include <sched.h>
+int main(int argc, char **argv)
+{
+  struct sched_param p;
+  return sched_setscheduler(0, SCHED_IDLE, &p);
+}
+EOF
+if compile_prog "" "" "SCHED_IDLE"; then
+  sched_idle="yes"
+fi
+echo "SCHED_IDLE                    $sched_idle"
+
 #############################################################################
 
 echo "# Automatically generated by configure - do not modify" > $config_host_mak
@@ -947,6 +964,9 @@
 if test "$rusage_thread" = "yes" ; then
   output_sym "CONFIG_RUSAGE_THREAD"
 fi
+if test "$sched_idle" = "yes" ; then
+  output_sym "CONFIG_SCHED_IDLE"
+fi
 
 echo "LIBS+=$LIBS" >> $config_host_mak
 echo "CC=$cc" >> $config_host_mak