aboutsummaryrefslogtreecommitdiffhomepage
path: root/container/syscall_close_range.go
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2026-03-17 14:19:00 +0900
committerOphestra <cat@gensokyo.uk>2026-03-17 14:19:00 +0900
commit0a12d456ce5869042dc06c43c360c43cab942d6b (patch)
treee94bcc00c5f96eb3683155ffec0fc6362b9aeb2e /container/syscall_close_range.go
parentd1fc1a3db73e61ef85667f835005659dc7c1cb1f (diff)
container: set CLOEXEC via close_range
This is guarded behind the close_range build tag for now. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'container/syscall_close_range.go')
-rw-r--r--container/syscall_close_range.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/container/syscall_close_range.go b/container/syscall_close_range.go
new file mode 100644
index 00000000..c4d6a051
--- /dev/null
+++ b/container/syscall_close_range.go
@@ -0,0 +1,11 @@
+//go:build close_range
+
+package container
+
+import "hakurei.app/ext"
+
+// doCloseOnExec implements ensureCloseOnExec by calling CloseRange with
+// CLOSE_RANGE_CLOEXEC.
+func doCloseOnExec() error {
+ return ext.CloseRange(0, ext.MaxUint, ext.CLOSE_RANGE_CLOEXEC)
+}