summaryrefslogtreecommitdiff
path: root/libstd/syswrap-ss+linux.myr
blob: 1982e54cafaeccefcfa4a1dd3f6957434b984df5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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
	;;
}