diff -r a29b72950795 Lib/test/test_posix.py --- a/Lib/test/test_posix.py Thu Sep 01 23:08:21 2011 +0200 +++ b/Lib/test/test_posix.py Sat Sep 03 18:08:01 2011 +0200 @@ -840,6 +840,8 @@ posix.sched_yield() @requires_sched_h + @unittest.skipUnless(hasattr(posix, 'sched_get_priority_max'), + "requires sched_get_priority_max()") def test_sched_priority(self): # Round-robin usually has interesting priorities. pol = posix.SCHED_RR diff -r a29b72950795 Modules/posixmodule.c --- a/Modules/posixmodule.c Thu Sep 01 23:08:21 2011 +0200 +++ b/Modules/posixmodule.c Sat Sep 03 18:08:01 2011 +0200 @@ -4555,6 +4555,8 @@ #ifdef HAVE_SCHED_H +#ifdef HAVE_SCHED_GET_PRIORITY_MAX + PyDoc_STRVAR(posix_sched_get_priority_max__doc__, "sched_get_priority_max(policy)\n\n\ Get the maximum scheduling priority for *policy*."); @@ -4589,6 +4591,8 @@ return PyLong_FromLong(min); } +#endif /* HAVE_SCHED_GET_PRIORITY_MAX */ + #ifdef HAVE_SCHED_SETSCHEDULER PyDoc_STRVAR(posix_sched_getscheduler__doc__, @@ -10452,8 +10456,10 @@ {"fork", posix_fork, METH_NOARGS, posix_fork__doc__}, #endif /* HAVE_FORK */ #ifdef HAVE_SCHED_H +#ifdef HAVE_SCHED_GET_PRIORITY_MAX {"sched_get_priority_max", posix_sched_get_priority_max, METH_VARARGS, posix_sched_get_priority_max__doc__}, {"sched_get_priority_min", posix_sched_get_priority_min, METH_VARARGS, posix_sched_get_priority_min__doc__}, +#endif #ifdef HAVE_SCHED_SETPARAM {"sched_getparam", posix_sched_getparam, METH_VARARGS, posix_sched_getparam__doc__}, #endif @@ -10474,7 +10480,7 @@ {"sched_setaffinity", posix_sched_setaffinity, METH_VARARGS, posix_sched_setaffinity__doc__}, {"sched_getaffinity", posix_sched_getaffinity, METH_VARARGS, posix_sched_getaffinity__doc__}, #endif -#endif +#endif /* HAVE_SCHED_H */ #if defined(HAVE_OPENPTY) || defined(HAVE__GETPTY) || defined(HAVE_DEV_PTMX) {"openpty", posix_openpty, METH_NOARGS, posix_openpty__doc__}, #endif /* HAVE_OPENPTY || HAVE__GETPTY || HAVE_DEV_PTMX */ diff -r a29b72950795 configure.in --- a/configure.in Thu Sep 01 23:08:21 2011 +0200 +++ b/configure.in Sat Sep 03 18:08:01 2011 +0200 @@ -2538,7 +2538,8 @@ select sem_open sem_timedwait sem_getvalue sem_unlink sendfile setegid seteuid \ setgid sethostname \ setlocale setregid setreuid setresuid setresgid setsid setpgid setpgrp setpriority setuid setvbuf \ - sched_setaffinity sched_setscheduler sched_setparam sched_rr_get_interval \ + sched_get_priority_max sched_setaffinity sched_setscheduler sched_setparam \ + sched_rr_get_interval \ sigaction sigaltstack siginterrupt sigpending sigrelse \ sigtimedwait sigwait sigwaitinfo snprintf strftime strlcpy symlinkat sync \ sysconf tcgetpgrp tcsetpgrp tempnam timegm times tmpfile tmpnam tmpnam_r \