Black Lives Matter. Support the Equal Justice Initiative.

Text file src/runtime/cgo/gcc_setenv.c

Documentation: runtime/cgo

     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  // +build cgo
     6  // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris
     7  
     8  #include "libcgo.h"
     9  
    10  #include <stdlib.h>
    11  
    12  /* Stub for calling setenv */
    13  void
    14  x_cgo_setenv(char **arg)
    15  {
    16  	_cgo_tsan_acquire();
    17  	setenv(arg[0], arg[1], 1);
    18  	_cgo_tsan_release();
    19  }
    20  
    21  /* Stub for calling unsetenv */
    22  void
    23  x_cgo_unsetenv(char **arg)
    24  {
    25  	_cgo_tsan_acquire();
    26  	unsetenv(arg[0]);
    27  	_cgo_tsan_release();
    28  }
    29  

View as plain text