ipc

package
v0.0.0-...-4c2072e Latest Latest
Warning

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

Go to latest
Published: May 23, 2024 License: Apache-2.0 Imports: 17 Imported by: 90

Documentation

Index

Constants

This section is empty.

Variables

Functions

func FeaturesToFlags

func FeaturesToFlags(features flatrpc.Feature, manual csource.Features) flatrpc.ExecEnv

func FlagsToSandbox

func FlagsToSandbox(flags flatrpc.ExecEnv) string

func SandboxToFlags

func SandboxToFlags(sandbox string) (flatrpc.ExecEnv, error)

Types

type Config

type Config struct {
	// Path to executor binary.
	Executor string

	UseShmem      bool // use shared memory instead of pipes for communication
	UseForkServer bool // use extended protocol with handshake
	RateLimit     bool // rate limit start of new processes for host fuzzer mode

	Timeouts targets.Timeouts
}

Config is the configuration for Env.

type Env

type Env struct {
	// contains filtered or unexported fields
}

func MakeEnv

func MakeEnv(config *Config, pid int) (*Env, error)

func (*Env) Close

func (env *Env) Close() error

func (*Env) Exec

func (env *Env) Exec(opts *flatrpc.ExecOpts, p *prog.Prog) (
	output []byte, info *flatrpc.ProgInfo, hanged bool, err0 error)

func (*Env) ExecProg

func (env *Env) ExecProg(opts *flatrpc.ExecOpts, progData []byte) (
	output []byte, info *flatrpc.ProgInfo, hanged bool, err0 error)

Exec starts executor binary to execute program stored in progData in exec encoding and returns information about the execution: output: process output info: per-call info hanged: program hanged and was killed err0: failed to start the process or bug in executor itself.

func (*Env) ForceRestart

func (env *Env) ForceRestart()

func (*Env) RestartIfNeeded

func (env *Env) RestartIfNeeded(opts *flatrpc.ExecOpts) error

RestartIfNeeded brings up an executor process if it was stopped.

type Gate

type Gate struct {
	// contains filtered or unexported fields
}

Gate limits concurrency level and window to the given value. Limitation of concurrency window means that if a very old activity is still running it will not let new activities to start even if concurrency level is low.

func NewGate

func NewGate(c int, f func()) *Gate

If f is not nil, it will be called after each batch of c activities.

func (*Gate) Enter

func (g *Gate) Enter() int

func (*Gate) Leave

func (g *Gate) Leave(idx int)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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