Sortix cross-volatile manual
This manual documents Sortix cross-volatile. You can instead view this document in the latest official manual.
NAME
kernelinfo — get information about the systemSYNOPSIS
#include <sys/kernelinfo.h>kernelinfo(const char *request, char *response, size_t resplen);
DESCRIPTION
kernelinfo() queries information about the currently running system, storing up to resplen bytes (including the terminating NUL byte) in response.- “name”
- The kernel's name, e.g. “Sortix”.
- “version”
- The kernel's version, e.g. “1.1.0-dev”.
- “tagline”
- The kernel's tagline, e.g. “\"Self-Hosting & Installable\"”.
- “options”
- The options the kernel was booted with, e.g. “--firmware=pc”. See kernel(7) for details.
- “builddate”
- The date when the kernel was built per the C __DATE__ macro, e.g. “Feb 13 2009”.
- “buildtime”
- The time when the kernel was built per the C __TIME__ macro, e.g. “23:31:30”.
- “firmware”
- The system's firmware, e.g. “bios” or “efi”.
RETURN VALUES
On success, zero is returned. If the information doesn't fit in the response, then the needed size (excluding the NUL byte) is returned and errno is set to ERANGE, and nothing is written to the response. On any other error, -1 is returned and errno is set, and nothing is written to the response.ERRORS
- EINVAL
- request doesn't point to a supported request string.
- ERANGE
- resplen is too small to contain the entire output. The return value is the expected size.