From acabbacdee68ad80e829bda56ae5363d04646d2d Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Wed, 29 Oct 2025 10:39:30 +0100 Subject: kstd: clean up libc implementation --- libs/kstd/include/kstd/bits/os.hpp | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) (limited to 'libs/kstd/include') diff --git a/libs/kstd/include/kstd/bits/os.hpp b/libs/kstd/include/kstd/bits/os.hpp index 7f5fcc8..0474f16 100644 --- a/libs/kstd/include/kstd/bits/os.hpp +++ b/libs/kstd/include/kstd/bits/os.hpp @@ -6,10 +6,29 @@ namespace kstd::os { - auto abort() -> bool; + /** + * @brief Handle an unrecoverable library error. + * + * The operating system kernel may choose to implement this function in order to try to perform additional cleanup + * before terminating execution. If the kernel does not implement this function, the default implementation will be + * chosen. This default implementation doest nothing. + */ + [[noreturn]] + auto abort() -> void; + /** + * @brief Terminate execution of the operating system. + * + * The operating system must implement this function. This function must terminate the execution of the operating + * system kernel as is. It may choose to restart the kernel or to halt execution entirely. The implementation must + * guarantee that execution never return from this function. + * + * @param message A message describing the reason for termination of execution. + * @param where The source code location at which the panic was triggered. In general, no argument shall be provided + * for this parameter, thus implicitly capturing the location at which the call originates. + */ [[noreturn]] - auto panic(std::string_view message, std::source_location = std::source_location::current()) -> void; -} + auto panic(std::string_view message, std::source_location where = std::source_location::current()) -> void; +} // namespace kstd::os #endif \ No newline at end of file -- cgit v1.2.3