hakurei: move container helpers toplevel

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
2025-07-02 21:31:29 +09:00
parent a1d98823f8
commit eec021cc4b
36 changed files with 21 additions and 21 deletions

28
seccomp/syscall.go Normal file
View File

@@ -0,0 +1,28 @@
package seccomp
import "iter"
// Syscalls returns an iterator over all wired syscalls.
func Syscalls() iter.Seq2[string, int] {
return func(yield func(string, int) bool) {
for name, num := range syscallNum {
if !yield(name, num) {
return
}
}
for name, num := range syscallNumExtra {
if !yield(name, num) {
return
}
}
}
}
// SyscallResolveName resolves a syscall number from its string representation.
func SyscallResolveName(name string) (num int, ok bool) {
if num, ok = syscallNum[name]; ok {
return
}
num, ok = syscallNumExtra[name]
return
}