aboutsummaryrefslogtreecommitdiffstats
path: root/csource/csource.go
diff options
context:
space:
mode:
authorAndrey Konovalov <andreyknvl@google.com>2016-10-04 16:12:12 +0200
committerAndrey Konovalov <andreyknvl@google.com>2016-11-29 17:39:38 +0100
commitc5707f5e575f3a4220faede18a51f7a8c7ee1377 (patch)
treed7b264b52b8ce35cd6de3db86dc742a30f980bfc /csource/csource.go
parent72e9b239f4d6b71e43acee4ca76de04e893400e8 (diff)
executor: emit ethernet traffic
Diffstat (limited to 'csource/csource.go')
-rw-r--r--csource/csource.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/csource/csource.go b/csource/csource.go
index 0c4d93ed3..42eca2038 100644
--- a/csource/csource.go
+++ b/csource/csource.go
@@ -59,7 +59,7 @@ func Write(p *prog.Prog, opts Options) ([]byte, error) {
generateTestFunc(w, opts, calls, "loop")
fmt.Fprint(w, "int main()\n{\n")
- fmt.Fprint(w, "\tsetup_main_process();\n")
+ fmt.Fprint(w, "\tsetup_main_process(0);\n")
fmt.Fprintf(w, "\tint pid = do_sandbox_%v();\n", opts.Sandbox)
fmt.Fprint(w, "\tint status = 0;\n")
fmt.Fprint(w, "\twhile (waitpid(pid, &status, __WALL) != pid) {}\n")
@@ -68,7 +68,7 @@ func Write(p *prog.Prog, opts Options) ([]byte, error) {
generateTestFunc(w, opts, calls, "test")
if opts.Procs <= 1 {
fmt.Fprint(w, "int main()\n{\n")
- fmt.Fprint(w, "\tsetup_main_process();\n")
+ fmt.Fprint(w, "\tsetup_main_process(0);\n")
fmt.Fprintf(w, "\tint pid = do_sandbox_%v();\n", opts.Sandbox)
fmt.Fprint(w, "\tint status = 0;\n")
fmt.Fprint(w, "\twhile (waitpid(pid, &status, __WALL) != pid) {}\n")
@@ -78,7 +78,7 @@ func Write(p *prog.Prog, opts Options) ([]byte, error) {
fmt.Fprint(w, "\tint i;")
fmt.Fprintf(w, "\tfor (i = 0; i < %v; i++) {\n", opts.Procs)
fmt.Fprint(w, "\t\tif (fork() == 0) {\n")
- fmt.Fprint(w, "\t\t\tsetup_main_process();\n")
+ fmt.Fprint(w, "\t\t\tsetup_main_process(i);\n")
fmt.Fprintf(w, "\t\t\tdo_sandbox_%v();\n", opts.Sandbox)
fmt.Fprint(w, "\t\t}\n")
fmt.Fprint(w, "\t}\n")