hare

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

commit 274b8b7296087cf576ab34d6bef0a57fd0c81b7b
parent 56b897157c311dd260feb836e2498daef478a538
Author: Sebastian <sebastian@sebsite.pw>
Date:   Sat,  4 Feb 2023 01:25:30 -0500

os::exec: add lifetime info to exitstr docs

Signed-off-by: Sebastian <sebastian@sebsite.pw>

Diffstat:
Mos/exec/process+freebsd.ha | 3++-
Mos/exec/process+linux.ha | 3++-
2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/os/exec/process+freebsd.ha b/os/exec/process+freebsd.ha @@ -153,7 +153,8 @@ export type signaled = int; // The exit status of a process. export type exit_status = (exited | signaled); -// Returns a human friendly string describing the exit status. +// Returns a human friendly string describing the exit status. The string is +// statically allocated; use [[strings::dup]] to extend its lifetime. export fn exitstr(status: exit_status) const str = { static let buf: [1024]u8 = [0...]; match (status) { diff --git a/os/exec/process+linux.ha b/os/exec/process+linux.ha @@ -139,7 +139,8 @@ export type signaled = int; // The exit status of a process. export type exit_status = (exited | signaled); -// Returns a human friendly string describing the exit status. +// Returns a human friendly string describing the exit status. The string is +// statically allocated; use [[strings::dup]] to extend its lifetime. export fn exitstr(status: exit_status) const str = { static let buf: [1024]u8 = [0...]; match (status) {