Documentation ¶
Overview ¶
Package runner provides common interface for program runner together with common types including Result, Limit, Size and Status.
Status ¶
Status defines the program running result status including
Normal Program Error Resource Limit Exceeded (Time / Memory / Output) Unauthorized Access (Disallowed Syscall) Runtime Error (Signaled / Nonzero Exit Status) Program Runner Error
Size ¶
Size defines size in bytes, underlying type is uint64 so it is effective to store up to EiB of size
Limit ¶
Limit defines Time & Memory restriction on program runner
Result ¶
Result defines program running result including Status, ExitStatus, Detailed Error, Time, Memory, SetupTime and RunningTime (in real clock)
Runner ¶
General interface to run a program, including a context for canclation
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Limit ¶
type Limit struct { TimeLimit time.Duration // user CPU time limit (in ns) MemoryLimit Size // user memory limit (in bytes) }
Limit represents the resource limit for traced process
type Result ¶
type Result struct { Status // result status ExitStatus int // exit status (signal number if signalled) Error string // potential detailed error message (for program runner error) Time time.Duration // used user CPU time (underlying type int64 in ns) Memory Size // used user memory (underlying type uint64 in bytes) // metrics for the program runner SetUpTime time.Duration RunningTime time.Duration }
Result is the program runner result
type Size ¶
type Size uint64
Size stores number of byte for the object. E.g. Memory. Maximun size is bounded by 64-bit limit
type Status ¶
type Status int
Status is the result Status
const ( StatusInvalid Status = iota // 0 not initialized // Normal StatusNormal // 1 normal // Resource Limit Exceeded StatusTimeLimitExceeded // 2 tle StatusMemoryLimitExceeded // 3 mle StatusOutputLimitExceeded // 4 ole // Unauthorized Access StatusDisallowedSyscall // 5 ban // Runtime Error StatusSignalled // 6 signalled StatusNonzeroExitStatus // 7 nonzero exit status // Programmer Runner Error StatusRunnerError // 8 runner error )
Result Status for program runner
Directories ¶
Path | Synopsis |
---|---|
Package unshare implements runner that uses Linux unshare syscall & mount namespace & rlimit to restrict program access
|
Package unshare implements runner that uses Linux unshare syscall & mount namespace & rlimit to restrict program access |