Files
linux-kernel-module-cheat/userland/linux/sysconf.c
Ciro Santilli 六四事件 法轮功 afb38d249b sysconf: move in from cpp-cheat
arm baremetal: give more TTBR rationale
2019-07-19 06:59:14 +01:00

14 lines
440 B
C

/* https://github.com/cirosantilli/linux-kernel-module-cheat#sysconf */
#define _XOPEN_SOURCE 700
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
int main(void) {
/* Number of processors, not considering affinity:
* 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));
return EXIT_SUCCESS;
}