hare

The Hare programming language
git clone https://git.torresjrjr.com/hare.git
Log | Files | Refs | README | LICENSE

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:
Mos/exec/process+freebsd.ha | 5+++++
Mos/exec/process+linux.ha | 5+++++
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,