commit 47f4d56ec3be3070011d73b60f1f22902ecdc452
parent e9ba76cf118e958c6ffbb7362137c306af2e8660
Author: Drew DeVault <sir@cmpwn.com>
Date: Mon, 24 Jan 2022 15:03:15 +0100
os::exec: add self()
Signed-off-by: Drew DeVault <sir@cmpwn.com>
Diffstat:
2 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/os/exec/process+freebsd.ha b/os/exec/process+freebsd.ha
@@ -6,6 +6,11 @@ use fmt;
// Stores information about a child process.
export type process = int;
+// Returns the currently running [[process]].
+export fn self() process = {
+ return rt::getpid();
+};
+
// Stores information about an exited process.
export type status = struct {
status: int,
diff --git a/os/exec/process+linux.ha b/os/exec/process+linux.ha
@@ -6,6 +6,11 @@ use fmt;
// Stores information about a child process.
export type process = int;
+// Returns the currently running [[process]].
+export fn self() process = {
+ return rt::getpid();
+};
+
// Stores information about an exited process.
export type status = struct {
status: int,