shithub: mc

ref: f995117702dd77f832b2a70ce94c4f5c9848efd4
dir: /lib/std/syswrap-ss+netbsd.myr/

View raw version
use sys
use "types"
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 exit	= {status;	sys.exit(status)}

const bgetcwd	= {buf
	-> (sys.__getcwd(buf) - 1 : errno)
}

const nanosleep	= {nsecs
	var req, rem
	var s, ns

	s = (nsecs / 1_000_000_000 : int64)
	ns = (nsecs % 1_000_000_000 : int64)
	req = [.sec = s, .nsec = ns]

	-> (sys.nanosleep(&req, &rem) : errno)
}