Skip to content
Snippets Groups Projects
Commit 66bf27bc authored by Robert Schmidt's avatar Robert Schmidt
Browse files

threadCreate(): check for and handle missing SYS_NICE

SYS_NICE is a capability that allows a process to set thread affinity
and priority, among other things (see capabilities(7) for more info).

In this commit, add a function that allows to determine if the process
has this capability, and try to change the thread affinity and priority,
if requested. If the capability does not exist, the function will simply
not attempt to change the corresponding thread attributes.

To determine if the process has SYS_NICE, libcap can be used. However,
it might not be installed by default. To avoid requiring another
dependency, if we detect that libcap is not present, use a workaround by
try to set a real-time scheduling policy; if it's present, or can be
changed, we assume that the process has SYS_NICE (and clean up, if
relevant).

Simplify reading of capabilities
parent 6a127848
No related branches found
No related tags found
2 merge requests!2778Integration: `2024.w22`,!2694Handle and use Linux capabilities, logging improvements, cleanup, documentation
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment