Page MenuHomeFreeBSD

cpuset: Add compat shim to the sched_affinity functions
ClosedPublic

Authored by dchagin on Feb 13 2023, 11:40 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Dec 11, 3:09 PM
Unknown Object (File)
Sun, Dec 7, 3:58 PM
Unknown Object (File)
Nov 19 2025, 5:25 AM
Unknown Object (File)
Nov 16 2025, 11:11 AM
Unknown Object (File)
Nov 14 2025, 9:59 PM
Unknown Object (File)
Oct 31 2025, 9:29 PM
Unknown Object (File)
Oct 31 2025, 8:00 PM
Unknown Object (File)
Oct 31 2025, 5:43 PM
Subscribers

Details

Summary

To allow to run a new world on the pre 1400079 kernel a compat shims to
the sched_affinity functions has beed added. PID_MAX is hardcoded as our
kernel does not expose it to the user space.

Reported by: antoine
Tested by: antoine

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

dchagin added a reviewer: kib.
lib/libc/gen/sched_getaffinity.c
37

Look at sys/param.h P_OSREL_XXX macros.

dchagin edited the summary of this revision. (Show Details)

better (beauty) naming, thanks)

better (beauty) naming, thanks)

Um, I mean that you should add your P_OSREL value to sys/param.h

In D38555#877827, @kib wrote:

better (beauty) naming, thanks)

Um, I mean that you should add your P_OSREL value to sys/param.h

sure? P_OSREL is under _KERNEL, thats why I do not do it

lib/libc/gen/sched_getaffinity.c
37

I would move this definition into libc_private.h, and add a comment explaining why we hardcode the value there.

done, may be put _PID_MAX under _WANT_P_OSREL condition?

done, may be put _PID_MAX under _WANT_P_OSREL condition?

No, they are unrelated.

lib/libc/include/libc_private.h
48

Add a blank line before this comment.

This revision is now accepted and ready to land.Feb 15 2023, 9:17 AM