ref: 81faf1634871ae20739df2d5eb6525f47d14da77
dir: /lib/std/syswrap-ss+freebsd.myr/
use sys use "errno" use "cstrconv" use "slcp" use "die" pkg std = const nanosleep : (nsecs : uint64 -> errno) $noret const exit : (status:int -> void) pkglocal const bgetcwd : (buf : byte[:] -> errno) ;; const nanosleep = {nsecs var req, rem var s, ns s = nsecs / 1_000_000_000 ns = nsecs % 1_000_000_000 req = [.sec = s, .nsec = ns] -> sys.nanosleep(&req, &rem) castto(errno) } const exit = {status sys.exit(status) } const bgetcwd = {buf var res res = sys.__getcwd(buf) castto(errno) if res == 0 -> cstrlen(buf) castto(errno) elif res == Enomem -> Erange else -> res ;; }