Repository navigation
fix(libkernel): return ENOTSUP from pthread_attr_setschedparam and setschedpolicy like libthr - #7028
Conversation
…tschedpolicy like libthr FreeBSD's libthr rejects a null sched_param and, under SCHED_FIFO or SCHED_RR, a priority outside sched_get_priority_min..max with ENOTSUP, and a policy outside SCHED_FIFO..SCHED_RR with ENOTSUP. The wrappers returned EINVAL for the null parameter and stored any priority or policy. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
|
|
Windows run in #7023 (comment): guest_pthread_attr 3/3, and the negative control fails as described. This is the only PR in the series that rejects input main accepted. RetroArch PPSA99169 calls setschedpolicy(1) and then setschedparam(700), which is inside 256..767 and accepted. The range is this project's, not verified on a console. Written with Claude Code assistance (validation by a subagent, reviewed in this session). |
|
Thanks for checking the callers, @screamm. Yes, this is the one PR in the series that refuses input AI-assisted: yes (Claude Code) |
What
pthread_attr_setschedparamandpthread_attr_setschedpolicyaccepted values that FreeBSD's libthr rejects:_pthread_attr_setschedparamreturnsENOTSUPfor a nullsched_param, and underSCHED_FIFOorSCHED_RRfor a priority outside the policy's range. It accepts any priority underSCHED_OTHER. The wrapper returnedEINVALfor the null pointer and stored any priority._pthread_attr_setschedpolicyreturnsENOTSUPfor a policy outsideSCHED_FIFO..SCHED_RR(1..3). The wrapper stored any policy.Both now return
ENOTSUP(45) in those cases and leave the attribute unchanged. The priority range is the onesched_get_priority_minandsched_get_priority_maxreport here for FIFO and RR (256..767), andscePthreadAttrSetschedparamuses the same range.Not changed: libthr's
setschedpolicyalso resets the priority to the policy's default, and this wrapper still keeps the previous priority. TheSCHED_OTHERdefault on the console isn't known to me.I don't know of a title that hits this. I found it while comparing the
pthread_attrwrappers with libthr.Tested
Ubuntu 24.04, GCC 13.3, Release, on
main6a32550.guest_pthread_attr: newCheckSchedArguments. A null parameter givesENOTSUP. Under FIFO and RR, priorities 0, 1, 255, 768 and 1000 giveENOTSUPand the stored priority is kept, while 256 and 767 are accepted. UnderSCHED_OTHER, 1000 is accepted. Policies -1, 0, 4 and 100 giveENOTSUPand the policy is kept. A null or unset attribute still givesEINVAL. Withmain'sPosix/Attr.cppthe test aborts at the null-parameter check (EINVALinstead ofENOTSUP). With this change it passes 3 of 3.ctest -R '^guest_|libc': 403 of 403 pass, with this and my other small libkernel argument fixes from today applied together.tools/check_conventions.pypasses.tools/pr_overlap.pyfinds no conflicting lines. It couldn't compare against test: organize library tests and label CTest suites #6044 (it conflicts withmain), which moves the test files.main's behaviour. (series run by @screamm)Not checked: macOS, a console.
Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code