diff options
Diffstat (limited to 'man3/CPU_SET.3')
-rw-r--r-- | man3/CPU_SET.3 | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/man3/CPU_SET.3 b/man3/CPU_SET.3 index c41dadc8d..aa5d71d77 100644 --- a/man3/CPU_SET.3 +++ b/man3/CPU_SET.3 @@ -4,7 +4,7 @@ .\" .\" SPDX-License-Identifier: Linux-man-pages-copyleft .\" -.TH CPU_SET 3 2022-10-09 "Linux man-pages 6.03" +.TH CPU_SET 3 2023-05-03 "Linux man-pages 6.05.01" .SH NAME CPU_SET, CPU_CLR, CPU_ISSET, CPU_ZERO, CPU_COUNT, CPU_AND, CPU_OR, CPU_XOR, CPU_EQUAL, @@ -224,7 +224,9 @@ returns the number of bytes required to store a CPU set of the specified cardinality. .PP The other functions do not return a value. -.SH VERSIONS +.SH STANDARDS +Linux. +.SH HISTORY The .BR CPU_ZERO (), .BR CPU_SET (), @@ -253,8 +255,6 @@ first appeared in glibc 2.6. and .BR CPU_EQUAL_S () first appeared in glibc 2.7. -.SH STANDARDS -These interfaces are Linux-specific. .SH NOTES To duplicate a CPU set, use .BR memcpy (3). @@ -306,36 +306,36 @@ used for dynamically allocated CPU sets. #include <stdio.h> #include <stdlib.h> #include <unistd.h> - +\& #include <assert.h> - +\& int main(int argc, char *argv[]) { cpu_set_t *cpusetp; size_t size, num_cpus; - +\& if (argc < 2) { fprintf(stderr, "Usage: %s <num\-cpus>\en", argv[0]); exit(EXIT_FAILURE); } - +\& num_cpus = atoi(argv[1]); - +\& cpusetp = CPU_ALLOC(num_cpus); if (cpusetp == NULL) { perror("CPU_ALLOC"); exit(EXIT_FAILURE); } - +\& size = CPU_ALLOC_SIZE(num_cpus); - +\& CPU_ZERO_S(size, cpusetp); for (size_t cpu = 0; cpu < num_cpus; cpu += 2) CPU_SET_S(cpu, size, cpusetp); - +\& printf("CPU_COUNT() of set: %d\en", CPU_COUNT_S(size, cpusetp)); - +\& CPU_FREE(cpusetp); exit(EXIT_SUCCESS); } |