aboutsummaryrefslogtreecommitdiffhomepage
path: root/container/seccomp/syscall.go
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2025-07-03 02:59:43 +0900
committerOphestra <cat@gensokyo.uk>2025-07-03 02:59:43 +0900
commit1b5ecd9eaf3289d164d8ed1bce6013e0e4ef8e86 (patch)
tree047fe5fabdfb37d5c0088f7f572cebc8b13853bb /container/seccomp/syscall.go
parent82561d62b66f17c05604e87f18187bb3a91f00d2 (diff)
container: move out of toplevel
This allows slightly easier use of the vanity url. This also provides some disambiguation between low level containers and hakurei app containers. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'container/seccomp/syscall.go')
-rw-r--r--container/seccomp/syscall.go28
1 files changed, 28 insertions, 0 deletions
diff --git a/container/seccomp/syscall.go b/container/seccomp/syscall.go
new file mode 100644
index 00000000..36a988aa
--- /dev/null
+++ b/container/seccomp/syscall.go
@@ -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
+}