shithub: mc

ref: a3bce47d15d25fc3bca79ee50fca3fd4df538d5b
dir: /lib/thread/fsbase+linux.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.arch_prctl(sys.Archsetfs, (h : void#))
	| 0:
	| err:
		std.fput(std.Err, "error: arch_prctl returned {}\n", err)
		std.suicide()
	;;
}

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