sys_sched_setaffinity(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

sys_sched_setaffinity(9) πŸ’–βœ¨

okay so bestie, welcome to the Kernel API Manual entry for sys_sched_setaffinity β€” the one that’s all about setting the CPU affinity of a process. It’s giving β€œtell this process which CPU it’s allowed to vibe on” energy, and honestly? iconic. πŸ’…


🌸 NAME 🌸

sys_sched_setaffinity β€” set the CPU affinity of a process.


✨ SYNOPSIS ✨

       long sys_sched_setaffinity (pid_t pid , unsigned int len , unsigned long
       __user * user_mask_ptr );

πŸŽ€ ARGUMENTS πŸŽ€

  • pid β€” the pid of the process. literally the process ID, bestie 🫢
  • len β€” length in bytes of the bitmask pointed to by user_mask_ptr. yes, bytes. no cap.
  • user_mask_ptr β€” user-space pointer to the new CPU mask. it’s the pointer bestie, the whole vibe check for the mask πŸ’«

🌈 RETURN 🌈

0 on success. An error code otherwise. that’s it, that’s the whole return situation 😌


πŸ¦‹ SEE ALSO πŸ¦‹

Kernel file: ./kernel/sched/syscalls.c


mwah πŸ’‹ this page came from the Kernel API Manual, source/version ./kernel/sched, dated October 2026, and it’s literally the sys_sched_setaffinity(9) page. bye bestie 🫢✨

πŸ“¦ where this page comes from