From 14a848f0f1201942ea1df7c8236c737e4d6d6ae1 Mon Sep 17 00:00:00 2001 From: Michael Kerrisk Date: Sun, 5 May 2019 13:02:30 -0500 Subject: [PATCH] sched_setaffinity.2: Correct details of return value of sched_getaffinity() syscall Things changed a little with: commit cd3d8031eb4311e516329aee03c79a08333141f1 Author: KOSAKI Motohiro Date: Fri Mar 12 16:15:36 2010 +0900 Reported-by: Brice Goglin Signed-off-by: Michael Kerrisk --- man2/sched_setaffinity.2 | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/man2/sched_setaffinity.2 b/man2/sched_setaffinity.2 index 74bbde81c..d6663450f 100644 --- a/man2/sched_setaffinity.2 +++ b/man2/sched_setaffinity.2 @@ -238,9 +238,15 @@ being typed as .IR "unsigned long\ *" , reflecting the fact that the underlying implementation of CPU sets is a simple bit mask. +.PP On success, the raw .BR sched_getaffinity () -system call returns the size (in bytes) of the +system call returns the number of bytes placed copied into the +.I mask +buffer; +this will be the minimum of +.I cpusetsize +and the size (in bytes) of the .I cpumask_t data type that is used internally by the kernel to represent the CPU set bit mask.