diff options
| author | Russ Cox <rsc@golang.org> | 2011-11-14 14:06:50 -0500 |
|---|---|---|
| committer | Russ Cox <rsc@golang.org> | 2011-11-14 14:06:50 -0500 |
| commit | 0acd879c267061814810f70d0f13b4c8767268b8 (patch) | |
| tree | d3af57359271318deccbd811eef3085ab9fa7161 /src/pkg/runtime/runtime.c | |
| parent | dc6726b37f54b0ae3db471de7f1631e6b5cf80e5 (diff) | |
| download | go-0acd879c267061814810f70d0f13b4c8767268b8.tar.xz | |
syscall: take over env implementation
The environment is needed by package time, which
we want not to depend on os (so that os can use
time.Time), so push down into syscall.
Delete syscall.Sleep, now unnecessary.
The package os environment API is preserved;
it is only the implementation that is moving to syscall.
Delete os.Envs, which was undocumented,
uninitialized on Windows and Plan 9, and
not maintained by Setenv and Clearenv.
Code can call os.Environ instead.
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5370091
Diffstat (limited to 'src/pkg/runtime/runtime.c')
| -rw-r--r-- | src/pkg/runtime/runtime.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/pkg/runtime/runtime.c b/src/pkg/runtime/runtime.c index a82e8b6b49..a609a26f80 100644 --- a/src/pkg/runtime/runtime.c +++ b/src/pkg/runtime/runtime.c @@ -172,7 +172,7 @@ static int32 argc; static uint8** argv; Slice os·Args; -Slice os·Envs; +Slice syscall·envs; void runtime·args(int32 c, uint8 **v) @@ -214,9 +214,9 @@ runtime·goenvs_unix(void) s = runtime·malloc(n*sizeof s[0]); for(i=0; i<n; i++) s[i] = runtime·gostringnocopy(argv[argc+1+i]); - os·Envs.array = (byte*)s; - os·Envs.len = n; - os·Envs.cap = n; + syscall·envs.array = (byte*)s; + syscall·envs.len = n; + syscall·envs.cap = n; } byte* @@ -229,8 +229,8 @@ runtime·getenv(int8 *s) bs = (byte*)s; len = runtime·findnull(bs); - envv = (String*)os·Envs.array; - envc = os·Envs.len; + envv = (String*)syscall·envs.array; + envc = syscall·envs.len; for(i=0; i<envc; i++){ if(envv[i].len <= len) continue; |
