From 2e2d1bd3b6c7776b77c33b94f30ead89367a71e6 Mon Sep 17 00:00:00 2001 From: Lexi Winter Date: Tue, 1 Jul 2025 17:07:04 +0100 Subject: add nihil.std --- nihil.posix/process.ccm | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'nihil.posix/process.ccm') diff --git a/nihil.posix/process.ccm b/nihil.posix/process.ccm index ee7de15..9fbf34c 100644 --- a/nihil.posix/process.ccm +++ b/nihil.posix/process.ccm @@ -1,19 +1,17 @@ // This source code is released into the public domain. module; -#include -#include -#include -#include - #include export module nihil.posix:process; +import nihil.std; import nihil.error; namespace nihil { +export struct process; + // wait_result: the exit status of a process. export struct wait_result final { @@ -58,7 +56,7 @@ private: }; // Represents a process we created, which can be waited for. -export struct process final +struct process final { process() = delete; @@ -83,7 +81,8 @@ export struct process final // Movable. process(process &&other) noexcept : m_pid(std::exchange(other.m_pid, -1)) - {} + { + } auto operator=(this process &self, process &&other) noexcept -> process & { @@ -113,7 +112,7 @@ export struct process final auto status = int{}; auto ret = waitpid(self.m_pid, &status, 0); if (ret == -1) - return std::unexpected(error(std::errc(errno))); + return error(sys_error()); return wait_result(status); } -- cgit v1.2.3