Files
tinygo/src/runtime/env_unix.go
T
Ayke van Laethem 1996fad075 windows: add support for syscall.runtimeSetenv
I missed this in https://github.com/tinygo-org/tinygo/pull/3391 (because
I didn't test on Windows, my fault).
2023-02-03 07:31:38 -08:00

24 lines
435 B
Go

//go:build linux || darwin
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)
}