forked from rosa/hakurei
container: set CLOEXEC via close_range
This is guarded behind the close_range build tag for now. Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
11
container/syscall_close_range.go
Normal file
11
container/syscall_close_range.go
Normal file
@@ -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)
|
||||
}
|
||||
Reference in New Issue
Block a user