Skip to content

Commit

Permalink
userspc_cpuaffinity.c: change the 'for this process..' msg
Browse files Browse the repository at this point in the history
Change the 'for this process..' to '... cores system-wide' as this better reflects the system state; + a minor comment fix
  • Loading branch information
kaiwan committed Jan 3, 2025
1 parent 321bc86 commit dab08fd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ch11/cpu_affinity/userspc_cpuaffinity.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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
*/
Expand Down

0 comments on commit dab08fd

Please sign in to comment.