https://github.com/qoretechnologies/module-sysconf
Qore sysconf module
https://github.com/qoretechnologies/module-sysconf
Last synced: 5 months ago
JSON representation
Qore sysconf module
- Host: GitHub
- URL: https://github.com/qoretechnologies/module-sysconf
- Owner: qoretechnologies
- License: lgpl-2.1
- Created: 2015-07-21T09:32:21.000Z (almost 11 years ago)
- Default Branch: develop
- Last Pushed: 2026-01-02T10:02:00.000Z (5 months ago)
- Last Synced: 2026-01-08T10:06:06.008Z (5 months ago)
- Language: CMake
- Homepage:
- Size: 113 KB
- Stars: 0
- Watchers: 13
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README
- License: COPYING
Awesome Lists containing this project
README
Qore sysconf Module
===================
The sysconf module provides Qore with access to runtime system configuration
information from the underlying operating system. The functionality wraps
standard C library system configuration functions.
Functions provided:
- sysconf(): Get system-wide runtime parameters (CPU count, memory limits, etc.)
- confstr(): Get string-valued configuration parameters (paths, versions, etc.)
- pathconf(): Query file system limits for specific paths
Quick Start
-----------
%requires sysconf
# Get the number of online CPUs
printf("CPUs online: %d\n", sysconf(Sysconf::SC_NPROCESSORS_ONLN));
# Get system page size
printf("Page size: %d bytes\n", sysconf(Sysconf::SC_PAGESIZE));
# Get maximum filename length for a path
printf("Max filename length: %d\n", pathconf("/tmp", Pathconf::PC_NAME_MAX));
# Get the default PATH
printf("Default PATH: %s\n", confstr(Confstr::CS_PATH));
Build Instructions
------------------
Requirements:
- Qore 1.12.4+ development environment (lib and headers)
- CMake 2.8.12+
- C++11 compatible compiler
- (optional) Doxygen for documentation
Use "out of source" build:
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=/path/to/install ..
make
make install
If -DCMAKE_INSTALL_PREFIX is not specified, the Qore module directory is used.
Running Tests
-------------
After building:
cd build
make test
Or run the test directly:
qore test/sysconf.qtest
Documentation
-------------
Full API documentation is generated with Doxygen:
cd build
make docs
License
-------
This module is released under the LGPL 2.1 license.
See the COPYING file for the full license text.
Repository
----------
https://github.com/qoretechnologies/module-sysconf