platform

package
v2.0.0-alpha.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 6, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package platform contains the small OS boundary for process ownership.

Index

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

func Executable(name string) string

Executable adds the native executable suffix to a tool name.

func Guard

func Guard() error

func Kill

func Kill(p *os.Process) error

Kill terminates only a process group created by Command.

func Own

func Own(path string, id *Identity) error

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

func ValidateIdentity(id *Identity) error

Types

type Identity

type Identity struct{ UID, GID uint32 }

Identity is an operating-system identity, not a PostgreSQL role.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL