aboutsummaryrefslogtreecommitdiffstats
path: root/nihil.posix/unistd.ccm
blob: 6f3b914f67fb159363773bb4b1af855f2e470440 (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.core;

// 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;
}

};