From dab08fd62ea54424bd6463211c24ee219ec77c76 Mon Sep 17 00:00:00 2001 From: Kaiwan N Billimoria Date: Fri, 3 Jan 2025 08:35:04 +0530 Subject: [PATCH] userspc_cpuaffinity.c: change the 'for this process..' msg Change the 'for this process..' to '... cores system-wide' as this better reflects the system state; + a minor comment fix --- ch11/cpu_affinity/userspc_cpuaffinity.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ch11/cpu_affinity/userspc_cpuaffinity.c b/ch11/cpu_affinity/userspc_cpuaffinity.c index dbb1102..2e51758 100644 --- a/ch11/cpu_affinity/userspc_cpuaffinity.c +++ b/ch11/cpu_affinity/userspc_cpuaffinity.c @@ -70,9 +70,9 @@ static void disp_cpumask(pid_t pid, cpu_set_t *cpumask, unsigned int ncores) printf("core# |"); for (i=ncores-1; i>=0; i--) - printf("%3d|", i); /* [0-999] cores; should do :-) + printf("%3d|", i); /* [1-999] cores; should do :-) * If not ok, you're too high-end for us :D - */ + */ printf("\n"); print_ruler_line(ncores); @@ -136,7 +136,7 @@ int main (int argc, char **argv) } numcores = get_nprocs(); - printf("Detected %d CPU cores [for this process %s:%d]\n", numcores, argv[0], getpid()); + printf("Detected %d CPU cores system-wide\n", numcores); /* we say 'for this process ...' as the number of cores available to processes can * change within a container */