aboutsummaryrefslogtreecommitdiffhomepage
path: root/helper/seccomp/export.go
diff options
context:
space:
mode:
Diffstat (limited to 'helper/seccomp/export.go')
-rw-r--r--helper/seccomp/export.go17
1 files changed, 17 insertions, 0 deletions
diff --git a/helper/seccomp/export.go b/helper/seccomp/export.go
new file mode 100644
index 00000000..1bcb7146
--- /dev/null
+++ b/helper/seccomp/export.go
@@ -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
+}