sysconf: move in from cpp-cheat

arm baremetal: give more TTBR rationale
This commit is contained in:
Ciro Santilli 六四事件 法轮功
2019-07-18 00:00:00 +00:00
parent 3ea041e4d9
commit afb38d249b
4 changed files with 49 additions and 0 deletions

13
userland/linux/sysconf.c Normal file
View File

@@ -0,0 +1,13 @@
/* 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;
}