~/bend-docscommunity

src/share/capped.bend checks

raw source on the hub · import ezx@1.18.0.0/src/share/capped.bend as Capped

share/capped: the words of a run under the memory cap share/cap sets, and what is said of a run the cap killed. They are apart from share/cap, which runs programs through snap's foreign effect, so that a law may import them (laws/CappedRunWords.bend).

3 imports
import Base
import snap@1.6.0.0/src/answer.bend as R
import ./env.bend as Env

Definitions

def scope source · line 11 · raw

@+gigs:String -> List<&2, String>

the cgroup a capped run gets. MemorySwapMax=0 matters: without it the cgroup spills into swap and the cap stops meaning anything.

def pre source · line 16 · raw

@on:Bool -> @+gigs:String -> List<&2, String>

the words a capped run is prefixed with, or none when nothing can cap it

def argv source · line 26 · raw

@on:Bool -> @+gigs:String -> @+at:String -> @args:List<&2, String> -> List<&2, String>

a program's arguments dressed the way the cap wants them, for a caller that is not going to run it here. The cap goes outside env, so the variable is set inside the cgroup.

def killed source · line 30 · raw

@+out:String -> Bool

the status the kernel leaves on a process it killed for memory

def why source · line 34 · raw

@+out:String -> @+gigs:String -> String

what to say when a run died for memory rather than for being wrong