# Linux Kernel Module Cheat
The perfect emulation setup to study and develop the <<linux-kernel>> v5.9.2, kernel modules, <<qemu-buildroot-setup,QEMU>>, <<gem5-buildroot-setup,gem5>> and x86_64, ARMv7 and ARMv8 <<userland-assembly,userland>> and <<baremetal-setup,baremetal>> assembly, <<c,ANSI C>>, <<cpp,C++>> and <<posix,POSIX>>. <<gdb>> and <<kgdb>> just work. Powered by <<about-the-qemu-buildroot-setup,Buildroot>> and <<about-the-baremetal-setup,crosstool-NG>>. Highly automated. Thoroughly documented. Automated <<test-this-repo,tests>>.

#### 27.4.5. sysconf

https://pubs.opengroup.org/onlinepubs/9699919799/functions/sysconf.html

Examples:

- userland/posix/sysconf.c

- userland/linux/sysconf.c showcases Linux extensions to POSIX

  Note that this blows up on gem5 userland due to `NPROCESSORS_ONLN` however: https://gem5.atlassian.net/browse/GEM5-622

Get lots of info on the system configuration.

The constants can also be viewed accessed on my Ubuntu 18.04 host with:

    getconf -a

`getconf` is also specified by POSIX at: https://pubs.opengroup.org/onlinepubs/9699919799/utilities/getconf.html but not the `-a` option which shows all configurations.

Busybox 1.31.1 clearly states that `getconf` is not implemented however at `docs/posix_conformance.txt`:

    POSIX Tools not supported:
      asa, at, batch, bc, c99, command, compress, csplit, ex, fc, file,
      gencat, getconf, iconv, join, link, locale, localedef, lp, m4,