diff options
| author | Ophestra <cat@gensokyo.uk> | 2025-09-04 04:15:25 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2025-09-04 04:15:25 +0900 |
| commit | ddfb865e2d526485935099a8cd454929ed5f6176 (patch) | |
| tree | ffcbb296924a904ea200259dd171d2ca86fc567d /system/system.go | |
| parent | 024d2ff7826a81db65eefa1843730b537ebdeef1 (diff) | |
system/dispatcher: wrap syscall helper functions
This allows tests to stub all kernel behaviour, like in the container package.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'system/system.go')
| -rw-r--r-- | system/system.go | 4 |
1 files changed, 3 insertions, 1 deletions
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 } |
