Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32.4k
bpo-41839: Fix error checking in sched_get_priority_ functions#22374
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
kulikjak commentedNov 2, 2020 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
If this seems too dangerous to merge, we can use the variant used by OmniOS instead, which makes the change Solaris specific. |
Is it guaranteed that a successul syscall clears errno? Because if yes, then the |
It is not guaranteed, and this simple case confirms that it is not being cleared:
but we can still do it ourselves. You are right that -1 is still a legitimate priority, and although I don't think it even happens in any Solaris (historically, some schedulers used -60 and 60, the newer ones are using positive values only), it is not impossible (and also, I might be wrong :)). I updated the code, now it should always work on systems where |
fe9ee56
tod1a27a6
Compare5b7ab02
to4d818a2
Compare4d818a2
tof55a532
Comparemtelka commentedFeb 8, 2024
What needs to be done to see this PR merged? The change is obviously improving compatibility with POSIX and there is not known any regression. Thank you. |
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Uh oh!
There was an error while loading.Please reload this page.
Python presumes that any negative number returned from
sched_get_priority_min
orsched_get_priority_max
indicates that error has occurred. However, neither Linux manual pages nor POSIX.1-2001 specification forbids negative values to be returned; only-1
has a special meaning for error.https://bugs.python.org/issue41839