From ddfb865e2d526485935099a8cd454929ed5f6176 Mon Sep 17 00:00:00 2001 From: Ophestra Date: Thu, 4 Sep 2025 04:15:25 +0900 Subject: system/dispatcher: wrap syscall helper functions This allows tests to stub all kernel behaviour, like in the container package. Signed-off-by: Ophestra --- system/system.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'system/system.go') diff --git a/system/system.go b/system/system.go index 1a653636..134e7cee 100644 --- a/system/system.go +++ b/system/system.go @@ -70,7 +70,7 @@ func New(ctx context.Context, uid int) (sys *I) { if ctx == nil || uid < 0 { panic("invalid call to New") } - return &I{ctx: ctx, uid: uid} + return &I{ctx: ctx, uid: uid, syscallDispatcher: direct{}} } // An I provides deferred operating system interaction. [I] must not be copied. @@ -86,6 +86,8 @@ type I struct { committed bool // the behaviour of Revert is only defined for up to one call reverted bool + + syscallDispatcher } func (sys *I) UID() int { return sys.uid } -- cgit v1.3.1