File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,15 @@ import (
99 "syscall"
1010)
1111
12+ // Args hold the command-line arguments, starting with the program name.
13+ var Args []string
14+
15+ func init () {
16+ Args = runtime_args ()
17+ }
18+
19+ func runtime_args () []string // in package runtime
20+
1221// Exit causes the current program to exit with the given status code.
1322// Conventionally, code zero indicates success, non-zero an error.
1423// The program terminates immediately; deferred functions are not run.
Original file line number Diff line number Diff line change @@ -24,9 +24,12 @@ func GOROOT() string {
2424 return "/usr/local/go"
2525}
2626
27+ // TODO: fill with real args.
28+ var args = []string {"/proc/self/exe" }
29+
2730//go:linkname os_runtime_args os.runtime_args
2831func os_runtime_args () []string {
29- return nil
32+ return args
3033}
3134
3235// Copy size bytes from src to dst. The memory areas must not overlap.
You can’t perform that action at this time.
0 commit comments