mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-05 19:43:44 +00:00
runtime: implement command line arguments in hosted environments
Implement command line arguments for Linux, MacOS and WASI.
This commit is contained in:
committed by
Ron Evans
parent
c47cdfa66f
commit
7b761fac78
@@ -23,7 +23,9 @@ func GOROOT() string {
|
||||
return "/usr/local/go"
|
||||
}
|
||||
|
||||
// TODO: fill with real args.
|
||||
// This is the default set of arguments, if nothing else has been set.
|
||||
// This may be overriden by modifying this global at runtime init (for example,
|
||||
// on Linux where there are real command line arguments).
|
||||
var args = []string{"/proc/self/exe"}
|
||||
|
||||
//go:linkname os_runtime_args os.runtime_args
|
||||
@@ -47,6 +49,9 @@ func memmove(dst, src unsafe.Pointer, size uintptr)
|
||||
// llvm.memset.p0i8.i32(ptr, 0, size, false).
|
||||
func memzero(ptr unsafe.Pointer, size uintptr)
|
||||
|
||||
//export strlen
|
||||
func strlen(ptr unsafe.Pointer) uintptr
|
||||
|
||||
// Compare two same-size buffers for equality.
|
||||
func memequal(x, y unsafe.Pointer, n uintptr) bool {
|
||||
for i := uintptr(0); i < n; i++ {
|
||||
|
||||
Reference in New Issue
Block a user