helper/seccomp: separate seccomp package
All checks were successful
Test / Create distribution (push) Successful in 1m39s
Test / Run NixOS test (push) Successful in 3m31s

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
2025-01-25 12:59:11 +09:00
parent 016da20443
commit 163f15e93f
7 changed files with 47 additions and 45 deletions

17
helper/seccomp/export.go Normal file
View File

@@ -0,0 +1,17 @@
package seccomp
import (
"io"
"os"
)
func Export(opts SyscallOpts) (f *os.File, err error) {
if f, err = tmpfile(); err != nil {
return
}
if err = exportFilter(f.Fd(), opts); err != nil {
return
}
_, err = f.Seek(0, io.SeekStart)
return
}