shithub: mc

ref: 4e656a4f039b9230c820f12d3b1e4a5c8e55cf47
dir: /libstd/syswrap-ss+linux.myr/

View raw version
use sys
use "errno.use"

pkg std =
	const exit	: (status:int -> void)
	pkglocal const bgetcwd	: (buf : byte[:] -> errno)
;;

const exit	= {status;	sys.exit_group(status)}
const bgetcwd	= {buf;
	var err
	err = sys.getcwd(buf) castto(errno)
	/*
	if we got a length back, it includes
	the nul byte. chop that off.
	*/
	if err > 0
		-> err - 1
	else
		-> err
	;;
}