aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/syscall/syscall_nonhosted.go
diff options
context:
space:
mode:
authorAyke van Laethem <[email protected]>2024-11-18 11:43:50 +0100
committerAyke <[email protected]>2024-11-19 07:51:58 +0100
commit289fceb3eaf0829d1e3b65228b95a79bd5fc9389 (patch)
treea810ecbeb175b360173b1df87485e4d0f285163d /src/syscall/syscall_nonhosted.go
parente12da15f7d230874ca95a257c50bca0fc39f262c (diff)
downloadtinygo-289fceb3eaf0829d1e3b65228b95a79bd5fc9389.tar.gz
tinygo-289fceb3eaf0829d1e3b65228b95a79bd5fc9389.zip
syscall: refactor environment handling
* Move environment functions to their own files. * Rewrite the WASIp2 version of environment variables to be much simpler (don't go through C functions).
Diffstat (limited to 'src/syscall/syscall_nonhosted.go')
-rw-r--r--src/syscall/syscall_nonhosted.go42
1 files changed, 0 insertions, 42 deletions
diff --git a/src/syscall/syscall_nonhosted.go b/src/syscall/syscall_nonhosted.go
index b56d71af6..4867d70f6 100644
--- a/src/syscall/syscall_nonhosted.go
+++ b/src/syscall/syscall_nonhosted.go
@@ -87,48 +87,6 @@ const (
MAP_ANONYMOUS = MAP_ANON
)
-func runtime_envs() []string
-
-func Getenv(key string) (value string, found bool) {
- env := runtime_envs()
- for _, keyval := range env {
- // Split at '=' character.
- var k, v string
- for i := 0; i < len(keyval); i++ {
- if keyval[i] == '=' {
- k = keyval[:i]
- v = keyval[i+1:]
- }
- }
- if k == key {
- return v, true
- }
- }
- return "", false
-}
-
-func Setenv(key, val string) (err error) {
- // stub for now
- return ENOSYS
-}
-
-func Unsetenv(key string) (err error) {
- // stub for now
- return ENOSYS
-}
-
-func Clearenv() (err error) {
- // stub for now
- return ENOSYS
-}
-
-func Environ() []string {
- env := runtime_envs()
- envCopy := make([]string, len(env))
- copy(envCopy, env)
- return envCopy
-}
-
func Open(path string, mode int, perm uint32) (fd int, err error) {
return 0, ENOSYS
}