| 1 |
// Copyright 2011 The Go Authors. All rights reserved. |
| 2 |
// Use of this source code is governed by a BSD-style |
| 3 |
// license that can be found in the LICENSE file. |
| 4 |
|
| 5 |
//go:build unix |
| 6 |
|
| 7 |
#include "libcgo.h" |
| 8 |
|
| 9 |
#include <stdlib.h> |
| 10 |
|
| 11 |
/* Stub for calling setenv */ |
| 12 |
void |
| 13 |
x_cgo_setenv(char **arg) |
| 14 |
{ |
| 15 |
_cgo_tsan_acquire(); |
| 16 |
setenv(arg[0], arg[1], 1); |
| 17 |
_cgo_tsan_release(); |
| 18 |
} |
| 19 |
|
| 20 |
/* Stub for calling unsetenv */ |
| 21 |
void |
| 22 |
x_cgo_unsetenv(char **arg) |
| 23 |
{ |
| 24 |
_cgo_tsan_acquire(); |
| 25 |
unsetenv(arg[0]); |
| 26 |
_cgo_tsan_release(); |
| 27 |
} |