From 0a12d456ce5869042dc06c43c360c43cab942d6b Mon Sep 17 00:00:00 2001 From: Ophestra Date: Tue, 17 Mar 2026 14:19:00 +0900 Subject: container: set CLOEXEC via close_range This is guarded behind the close_range build tag for now. Signed-off-by: Ophestra --- container/syscall_close_range.go | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 container/syscall_close_range.go (limited to 'container/syscall_close_range.go') 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) +} -- cgit v1.3.1