_SC_NPROCESSORS_CONF

This commit is contained in:
Ciro Santilli 六四事件 法轮功
2019-11-12 00:00:00 +00:00
parent 86caa918a8
commit bb552d00a4
2 changed files with 3 additions and 2 deletions

View File

@@ -25,8 +25,7 @@ int main(int argc, char **argv) {
chars = mmap( chars = mmap(
NULL, NULL,
nbytes, nbytes,
PROT_READ | PROT_WRITE, PROT_READ | PROT_WRITE, MAP_SHARED | MAP_ANONYMOUS,
MAP_SHARED | MAP_ANONYMOUS,
-1, -1,
0 0
); );

View File

@@ -9,5 +9,7 @@ int main(void) {
/* Number of processors, not considering affinity: /* Number of processors, not considering affinity:
* http://stackoverflow.com/questions/2693948/how-do-i-retrieve-the-number-of-processors-on-c-linux */ * http://stackoverflow.com/questions/2693948/how-do-i-retrieve-the-number-of-processors-on-c-linux */
printf("_SC_NPROCESSORS_ONLN = %ld\n", sysconf(_SC_NPROCESSORS_ONLN)); printf("_SC_NPROCESSORS_ONLN = %ld\n", sysconf(_SC_NPROCESSORS_ONLN));
/* CPUs configured by OS during boog. Some may have gone offline, so could be larger than _SC_NPROCESSORS_ONLN.a */
printf("_SC_NPROCESSORS_CONF = %ld\n", sysconf(_SC_NPROCESSORS_CONF));
return EXIT_SUCCESS; return EXIT_SUCCESS;
} }