sandbox/seccomp: native rule type alias

This makes it easier to keep API stable.

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
2025-07-02 00:00:08 +09:00
parent 1a8840bebc
commit 0c5409aec7
2 changed files with 80 additions and 76 deletions

View File

@@ -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
}