From 0c5409aec7455cbe9e34b0e4d2f0edf0bc3c6e37 Mon Sep 17 00:00:00 2001 From: Ophestra Date: Wed, 2 Jul 2025 00:00:08 +0900 Subject: sandbox/seccomp: native rule type alias This makes it easier to keep API stable. Signed-off-by: Ophestra --- sandbox/seccomp/libseccomp.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'sandbox/seccomp/libseccomp.go') diff --git a/sandbox/seccomp/libseccomp.go b/sandbox/seccomp/libseccomp.go index 58ae8599..28a9628b 100644 --- a/sandbox/seccomp/libseccomp.go +++ b/sandbox/seccomp/libseccomp.go @@ -49,12 +49,17 @@ func (e *LibraryError) Is(err error) bool { (e.Errno != nil && errors.Is(err, e.Errno)) } +type ( + ScmpSyscall = C.int + ScmpErrno = C.int +) + // A NativeRule specifies an arch-specific action taken by seccomp under certain conditions. type NativeRule struct { // Syscall is the arch-dependent syscall number to act against. - Syscall C.int + Syscall ScmpSyscall // Errno is the errno value to return when the condition is satisfied. - Errno C.int + Errno ScmpErrno // Arg is the optional struct scmp_arg_cmp passed to libseccomp. Arg *ScmpArgCmp } -- cgit v1.3.1