1 /* go-unsetenv.c -- unset an environment variable from Go.
3 Copyright 2015 The Go Authors. All rights reserved.
4 Use of this source code is governed by a BSD-style
5 license that can be found in the LICENSE file. */
14 /* Unset an environment variable from Go. This is called by
17 void unsetenv_c (String
) __asm__ (GOSYM_PREFIX
"syscall.unsetenv_c");
27 ks
= (const byte
*) "";
34 kn
= malloc (k
.len
+ 1);
36 runtime_throw ("out of malloc memory");
37 __builtin_memcpy (kn
, ks
, k
.len
);
41 unsetenv ((const char *) ks
);
43 #endif /* !defined(HAVE_UNSETENV) */