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. */
17 /* Unset an environment variable from Go. This is called by
20 void unsetenv_c (String
) __asm__ (GOSYM_PREFIX
"syscall.unsetenv_c");
31 ks
= (const byte
*) "";
36 if (ks
!= NULL
&& ks
[k
.len
] != 0)
38 // Objects that are explicitly freed must be at least 16 bytes in size,
39 // so that they are not allocated using tiny alloc.
43 kn
= __go_alloc (len
);
44 __builtin_memcpy (kn
, ks
, k
.len
);
48 unsetenv ((const char *) ks
);
50 #endif /* !defined(HAVE_UNSETENV) */