Sortix
Sortix Download Manual Development Source Code News Blog More
current nightly

Sortix nightly manual

This manual documents Sortix nightly, a development build that has not been officially released. You can instead view this document in the latest official manual.

KERNELINFO(2) System Calls Manual KERNELINFO(2)

NAME

kernelinfo — get information about the system

SYNOPSIS

#include <sys/kernelinfo.h>

ssize_t
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.

request is a string requesting one of the following pieces of information:

"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.

SEE ALSO

kernelinfo(1), uname(1), uname(2), kernel(7)

HISTORY

The kernelinfo syscall originally appeared in Sortix 0.6.

November 15, 2025 Sortix 1.1.0-dev
Copyright 2011-2026 Jonas 'Sortie' Termansen and contributors.
Sortix's source code is free software under the ISC license.
#sortix on irc.sortix.org
@sortix_org