User Tools

Site Tools


realtime:documentation:howto:tools:cpu-partitioning:sched_getsetaffinity

sched_[get|set]affinity

Linux provides a couple of system calls to set the and get the CPU affinity of the current process, this are:

int sched_setaffinity(pid_t pid, size_t cpusetsize, const cpu_set_t *mask);
 
int sched_getaffinity(pid_t pid, size_t cpusetsize, cpu_set_t *mask);

The official description on these system calls and data structures used, can be obtain from the man page executing

$ man sched_setaffinity
realtime/documentation/howto/tools/cpu-partitioning/sched_getsetaffinity.txt · Last modified: 2023/09/05 09:07 by costa.shul