mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
Issue #12871: sched_get_priority_(min|max) might not be defined even though
<sched.h> is available (most notably on OpenBSD when built without pthread): add an explicit configure check.
This commit is contained in:
parent
e0afb16a31
commit
ea0d5fcb4a
5 changed files with 299 additions and 309 deletions
|
@ -4555,6 +4555,8 @@ posix_fork(PyObject *self, PyObject *noargs)
|
|||
|
||||
#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 @@ posix_sched_get_priority_min(PyObject *self, PyObject *args)
|
|||
return PyLong_FromLong(min);
|
||||
}
|
||||
|
||||
#endif /* HAVE_SCHED_GET_PRIORITY_MAX */
|
||||
|
||||
#ifdef HAVE_SCHED_SETSCHEDULER
|
||||
|
||||
PyDoc_STRVAR(posix_sched_getscheduler__doc__,
|
||||
|
@ -10452,8 +10456,10 @@ static PyMethodDef posix_methods[] = {
|
|||
{"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 @@ static PyMethodDef posix_methods[] = {
|
|||
{"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 */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue