Modern POSIX systems (such as Linux) have a binarygetconf which can access the system callssysconf,pathconf andconfstr.This package brings the values back to R.
This package requires access to these system calls, and definitionsof its data structures in the system header files. We have used itexclusively on Linux and OS X so far. Itshould (orcould) work on other POSIX-based operating systems, andcontributions to make it build more widely would be very welcome.
The first function corresponds togetconf -a andprovides all values which can be retried – currently 320 on mysystems.
R> res<-getAll()R>head(res) key value type1 LINK_MAX65000 path2 _POSIX_LINK_MAX65000 path3 MAX_CANON255 path4 _POSIX_MAX_CANON255 path5 MAX_INPUT255 path6 _POSIX_MAX_INPUT255 pathR>tail(res) key value type315 LEVEL4_CACHE_ASSOC0 sys316 LEVEL4_CACHE_LINESIZE0 sys317 IPV6200809 sys318 RAW_SOCKETS200809 sys319 _POSIX_IPV6200809 sys320 _POSIX_RAW_SOCKETS200809 sysR>The second example provides read access to individual settings:
R>getConfig("_NPROCESSORS_CONF")[1]8R>getConfig("LEVEL1_ICACHE_SIZE")[1]32768R>getConfig("GNU_LIBC_VERSION")[1]"glibc 2.23"R>The package is onCRAN andcan be installed from every mirror via
install.packages("RcppGetconf")It contains two useful functions right now. It currently buildscleanly on Linux and OS X; reports from other builds would (and PRswhere needed) would be greatly appreciated.
Dirk Eddelbuettel
GPL (>= 2)
Initially created: Thu Jul 28 22:27:52 CDT 2016
Last modified: Sun May 26 10:12:05 CDT 2024