From b852402f67b22a3a850ce4eb1305a3ce5898d128 Mon Sep 17 00:00:00 2001 From: Ophestra Date: Tue, 17 Mar 2026 15:48:40 +0900 Subject: ext: move syscall wrappers from container These are generally useful, and none of them are container-specific. Syscalls subtle to use and requiring container-specific setup remains in container. Signed-off-by: Ophestra --- container/dispatcher.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'container/dispatcher.go') diff --git a/container/dispatcher.go b/container/dispatcher.go index 710e4392..dce5f023 100644 --- a/container/dispatcher.go +++ b/container/dispatcher.go @@ -13,6 +13,7 @@ import ( "hakurei.app/container/seccomp" "hakurei.app/container/std" + "hakurei.app/ext" "hakurei.app/internal/netlink" "hakurei.app/message" ) @@ -143,8 +144,8 @@ func (k direct) new(f func(k syscallDispatcher)) { go f(k) } func (direct) lockOSThread() { runtime.LockOSThread() } -func (direct) setPtracer(pid uintptr) error { return SetPtracer(pid) } -func (direct) setDumpable(dumpable uintptr) error { return SetDumpable(dumpable) } +func (direct) setPtracer(pid uintptr) error { return ext.SetPtracer(pid) } +func (direct) setDumpable(dumpable uintptr) error { return ext.SetDumpable(dumpable) } func (direct) setNoNewPrivs() error { return SetNoNewPrivs() } func (direct) lastcap(msg message.Msg) uintptr { return LastCap(msg) } @@ -152,7 +153,7 @@ func (direct) capset(hdrp *capHeader, datap *[2]capData) error { return capset(h func (direct) capBoundingSetDrop(cap uintptr) error { return capBoundingSetDrop(cap) } func (direct) capAmbientClearAll() error { return capAmbientClearAll() } func (direct) capAmbientRaise(cap uintptr) error { return capAmbientRaise(cap) } -func (direct) isatty(fd int) bool { return Isatty(fd) } +func (direct) isatty(fd int) bool { return ext.Isatty(fd) } func (direct) receive(key string, e any, fdp *uintptr) (func() error, error) { return Receive(key, e, fdp) } -- cgit v1.3.1