diff options
| author | Ophestra <cat@gensokyo.uk> | 2025-06-26 03:48:15 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2025-06-26 03:49:07 +0900 |
| commit | 9a8a0479084913f1b835e65e5e9f900e4cd9dbf7 (patch) | |
| tree | 53884ff3ee0e984711f4802320feb5a638bc3fdd /sandbox/seccomp/seccomp.go | |
| parent | 863bf69ad32e44d06c654c8cfae875e37b8e5e5a (diff) | |
sandbox/seccomp: syscall name lookup table
The script is from Go source of same name. The result is checked against libseccomp.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'sandbox/seccomp/seccomp.go')
| -rw-r--r-- | sandbox/seccomp/seccomp.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/sandbox/seccomp/seccomp.go b/sandbox/seccomp/seccomp.go index f897ee5f..c9a201e2 100644 --- a/sandbox/seccomp/seccomp.go +++ b/sandbox/seccomp/seccomp.go @@ -13,6 +13,7 @@ import ( "fmt" "runtime" "syscall" + "unsafe" ) // LibraryError represents a libseccomp error. @@ -114,3 +115,11 @@ func buildFilter(fd int, opts FilterOpts) error { } return err } + +// only used for testing +func syscallResolveName(s string) (trap int) { + v := C.CString(s) + trap = int(C.seccomp_syscall_resolve_name(v)) + C.free(unsafe.Pointer(v)) + return +} |
