aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/csource/csource.go
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2020-12-22 12:01:52 +0100
committerDmitry Vyukov <dvyukov@google.com>2020-12-25 10:12:41 +0100
commitf8f67d67d3daa783c2bb7c9993c0ccb637af1a0e (patch)
treed17cd1f31315f1466673d951dad6ee9e309d66ec /pkg/csource/csource.go
parent549d0d03df068e7cc1d48f92ba1ba76153c91339 (diff)
executor: remove hardcoded timeouts
In preparation for making timeouts tunable based on OS/arch/VM/etc de-hardcode all (almost) timeouts in executor.
Diffstat (limited to 'pkg/csource/csource.go')
-rw-r--r--pkg/csource/csource.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/pkg/csource/csource.go b/pkg/csource/csource.go
index 49babbf41..b53b3b97f 100644
--- a/pkg/csource/csource.go
+++ b/pkg/csource/csource.go
@@ -93,13 +93,14 @@ func Write(p *prog.Prog, opts Options) ([]byte, error) {
replacements["SANDBOX_FUNC"] = replacements["SYSCALLS"]
replacements["SYSCALLS"] = "unused"
}
+ replacements["PROGRAM_TIMEOUT_MS"] = "5000"
timeoutExpr := "45"
for i, call := range p.Calls {
if timeout := call.Meta.Attrs.Timeout; timeout != 0 {
timeoutExpr += fmt.Sprintf(" + (call == %d ? %d : 0)", i, timeout)
}
}
- replacements["CALL_TIMEOUT"] = timeoutExpr
+ replacements["CALL_TIMEOUT_MS"] = timeoutExpr
result, err := createCommonHeader(p, mmapProg, replacements, opts)
if err != nil {
return nil, err