aboutsummaryrefslogtreecommitdiffhomepage
path: root/seccomp/seccomp.go
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2025-03-17 01:09:12 +0900
committerOphestra <cat@gensokyo.uk>2025-03-17 01:10:27 +0900
commitee108603572101ad3c285830e04ee248916b6c5d (patch)
treee3d2274301cf7f1ed39df9c510672745fbe0b08a /seccomp/seccomp.go
parent44277dc0f1fd1806f5ceea34246a4c805a06b61b (diff)
seccomp: install output atomically
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'seccomp/seccomp.go')
-rw-r--r--seccomp/seccomp.go11
1 files changed, 1 insertions, 10 deletions
diff --git a/seccomp/seccomp.go b/seccomp/seccomp.go
index 05c314c9..2e730479 100644
--- a/seccomp/seccomp.go
+++ b/seccomp/seccomp.go
@@ -13,8 +13,6 @@ import (
"syscall"
)
-var CPrintln func(v ...any)
-
// LibraryError represents a libseccomp error.
type LibraryError struct {
Prefix string
@@ -99,7 +97,7 @@ func buildFilter(fd int, opts SyscallOpts) error {
// this removes repeated transitions between C and Go execution
// when producing log output via F_println and CPrintln is nil
- if CPrintln != nil {
+ if fp := printlnP.Load(); fp != nil {
opts |= flagVerbose
}
@@ -114,10 +112,3 @@ func buildFilter(fd int, opts SyscallOpts) error {
}
return err
}
-
-//export F_println
-func F_println(v *C.char) {
- if CPrintln != nil {
- CPrintln(C.GoString(v))
- }
-}