Documentation
¶
Overview ¶
Package platform contains the small OS boundary for process ownership.
Index ¶
- func Command(ctx context.Context, identity *Identity, name string, args ...string) (*exec.Cmd, func(), error)
- func Executable(name string) string
- func Guard() error
- func Kill(p *os.Process) error
- func Own(path string, id *Identity) error
- func ProtectExecutableWrite() func()
- func ValidateIdentity(id *Identity) error
- type Identity
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Command ¶
func Command(ctx context.Context, identity *Identity, name string, args ...string) (*exec.Cmd, func(), error)
Command applies identity and process isolation before any child can execute. The caller must invoke release after Run or Start, even on error.
func Executable ¶
Executable adds the native executable suffix to a tool name.
func ProtectExecutableWrite ¶
func ProtectExecutableWrite() func()
ProtectExecutableWrite prevents another goroutine's fork from inheriting a writable descriptor for a new executable. CLOEXEC closes it only at exec; Linux can otherwise reject our launch with ETXTBSY during that interval.
func ValidateIdentity ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.