/* * Copyright (c) 2021, Mahmoud Mandour * * SPDX-License-Identifier: BSD-2-Clause */ #include #include #ifdef AK_OS_SERENITY # include #endif namespace Core::Version { ErrorOr read_long_version_string() { #ifdef AK_OS_SERENITY struct utsname uts; int rc = uname(&uts); if ((rc) < 0) { return Error::from_syscall("uname"sv, rc); } auto const* version = uts.release; auto const* git_hash = uts.version; return String::formatted("Version {} revision {}", version, git_hash); #else return "Version 1.0"_string; #endif } }