aboutsummaryrefslogtreecommitdiff
path: root/libgo/runtime/env_posix.c
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2016-09-29 00:56:44 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2016-09-29 00:56:44 +0000
commit6748787813f8080f853766877f6933bc0823c19d (patch)
tree6027c64554992aac2983e759bd0b0ac9d443369e /libgo/runtime/env_posix.c
parent83194649d2ba2461b60be6e4b1a8db2b7d10412d (diff)
downloadgcc-6748787813f8080f853766877f6933bc0823c19d.zip
gcc-6748787813f8080f853766877f6933bc0823c19d.tar.gz
gcc-6748787813f8080f853766877f6933bc0823c19d.tar.bz2
runtime: copy runtime.go and runtime1.go from Go 1.7
Also copy over cputicks.go, env_posix.go, vdso_none.go, stubs2.go, and a part of os_linux.go. Remove the corresponding functions from the C code in libgo/go/runtime. Add some transitional support functions to stubs.go. This converts several minor functions from C to Go. Reviewed-on: https://go-review.googlesource.com/29962 From-SVN: r240609
Diffstat (limited to 'libgo/runtime/env_posix.c')
-rw-r--r--libgo/runtime/env_posix.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libgo/runtime/env_posix.c b/libgo/runtime/env_posix.c
index b93edd6..3a60682 100644
--- a/libgo/runtime/env_posix.c
+++ b/libgo/runtime/env_posix.c
@@ -9,7 +9,7 @@
#include "arch.h"
#include "malloc.h"
-extern Slice envs;
+extern Slice runtime_get_envs(void);
String
runtime_getenv(const char *s)
@@ -17,12 +17,14 @@ runtime_getenv(const char *s)
int32 i, j;
intgo len;
const byte *v, *bs;
+ Slice envs;
String* envv;
int32 envc;
String ret;
bs = (const byte*)s;
len = runtime_findnull(bs);
+ envs = runtime_get_envs();
envv = (String*)envs.__values;
envc = envs.__count;
for(i=0; i<envc; i++){