===== sched_[get|set]affinity =====
Linux provides a couple of system calls to set the and get the
[[realtime:documentation:howto:tools:cpu-partitioning:start#cpu_affinity_of_tasks|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 [[http://man7.org/linux/man-pages/man2/sched_setaffinity.2.html|man page]] executing
$ man sched_setaffinity