blob: 65cd015a3cf06239232cace51673608c4010077e (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
// This source code is released into the public domain.
module;
#include <unistd.h>
export module nihil.posix:unistd;
import nihil.std;
import nihil.util;
// Symbols from unistd.h that might be useful.
namespace nihil {
export [[nodiscard]] auto fork() -> std::expected<::pid_t, error>
{
auto const pid = ::fork();
if (pid == -1)
return std::unexpected(error(sys_error()));
return pid;
}
};
|