Files
tinygo/src/runtime/env_unix.go
Ayke van Laethem a545f17d2e wasm: add support for GOOS=wasip1
This adds true GOOS=wasip1 support in addition to our existing
-target=wasi support. The old support for WASI isn't removed, but should
be treated as deprecated and will likely be removed eventually to reduce
the test burden.
2023-08-17 18:16:54 +02:00

24 lines
445 B
Go

//go:build linux || darwin || wasip1
package runtime
// int setenv(const char *name, const char *val, int replace);
//
//export setenv
func libc_setenv(name *byte, val *byte, replace int32) int32
// int unsetenv(const char *name);
//
//export unsetenv
func libc_unsetenv(name *byte) int32
func setenv(key, val *byte) {
// ignore any errors
libc_setenv(key, val, 1)
}
func unsetenv(key *byte) {
// ignore any errors
libc_unsetenv(key)
}