system

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2018 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExecWithLimits

func ExecWithLimits(limits *ProcessLimitValues, command string, args ...string) ([]byte, error)

ExecWithLimits executes a command with process limits

func SetAddressSpaceLimit

func SetAddressSpaceLimit(pid int, value uint64) error

SetAddressSpaceLimit sets a limit on total address space of a process

func SetCPUTimeLimit

func SetCPUTimeLimit(pid int, value uint64) error

SetCPUTimeLimit sets a limit on the total cpu time a process may have

Types

type ProcessLimitValues

type ProcessLimitValues struct {
	AddressSpaceLimit uint64
	CPUTimeLimit      uint64
}

ProcessLimitValues specifies the resource limits available to a process

type ProcessLimiter

type ProcessLimiter interface {
	SetAddressSpaceLimit(pid int, value uint64) error
	SetCPUTimeLimit(pid int, value uint64) error
}

ProcessLimiter defines the methods limiting resources of a Process

func NewProcessLimiter

func NewProcessLimiter() ProcessLimiter

NewProcessLimiter returns a new ProcessLimiter

Jump to

Keyboard shortcuts

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