shithub: mc

ref: 3c7cf598f83d27ac3b98e0061075052f9f9baaf1
dir: /lib/thread/fsbase+freebsd.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.Archamd64setfs, &(h : void#))
	| 0:
	| err:
		std.fput(std.Err, "error: sysarch returned {}\n", err)
		std.suicide()
	;;
}

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