shithub: mc

ref: 89182b0cf8f7adf2f8a4708d750452d9a226aeea
dir: /lib/std/syswrap-ss+freebsd.myr/

View raw version
use sys
use "errno"
use "cstrconv"
use "slcp"
use "die"

pkg std =
	const exit	: (status:int -> void)
	pkglocal const bgetcwd	: (buf : byte[:] -> 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
	;;
}