mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-23 02:05:57 +01:00
sysconf: move in from cpp-cheat
arm baremetal: give more TTBR rationale
This commit is contained in:
13
userland/linux/sysconf.c
Normal file
13
userland/linux/sysconf.c
Normal 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;
|
||||
}
|
||||
Reference in New Issue
Block a user