shithub: mc

ref: cbf8e144771b88703180db26d74f1c65e45d84fe
dir: /lib/thread/fsbase+netbsd.myr/

View raw version
use std
use sys

use "types"

pkg thread =
	pkglocal const setfsbase : (h : tlshdr# -> void)
	pkglocal const getfsbase : (-> tlshdr#)
;;

const setfsbase = {h
	match sys.sysarch(sys.X8664setfsbase, &(h : void#))
	| 0:
	| err:
		std.fput(std.Err, "error: sysarch returned: {}\n", err)
		std.suicide()
	;;
}

const getfsbase = {
	var h
	match sys.sysarch(sys.X8664getfsbase, &h)
	| 0: -> (h : tlshdr#)
	| err:
		std.fput(std.Err, "error: sysarch returned: {}\n", err)
		std.suicide()
	;;
}