diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/os/Makefile | 6 | ||||
-rw-r--r-- | src/lib/os/proc_darwin.go (renamed from src/lib/os/proc.go) | 0 | ||||
-rw-r--r-- | src/lib/os/proc_linux.go | 20 |
3 files changed, 23 insertions, 3 deletions
diff --git a/src/lib/os/Makefile b/src/lib/os/Makefile index e7b49e5b9..0334734d1 100644 --- a/src/lib/os/Makefile +++ b/src/lib/os/Makefile @@ -3,7 +3,7 @@ # license that can be found in the LICENSE file. # DO NOT EDIT. Automatically generated by gobuild. -# gobuild -m dir_${GOARCH}_${GOOS}.go env.go error.go file.go proc.go stat_${GOARCH}_${GOOS}.go time.go types.go exec.go >Makefile +# gobuild -m dir_${GOARCH}_${GOOS}.go env.go error.go file.go proc_${GOOS}.go stat_${GOARCH}_${GOOS}.go time.go types.go exec.go >Makefile D= @@ -41,7 +41,7 @@ coverage: packages O1=\ error.$O\ - proc.$O\ + proc_$(GOOS).$O\ types.$O\ O2=\ @@ -61,7 +61,7 @@ phases: a1 a2 a3 a4 _obj$D/os.a: phases a1: $(O1) - $(AR) grc _obj$D/os.a error.$O proc.$O types.$O + $(AR) grc _obj$D/os.a error.$O proc_$(GOOS).$O types.$O rm -f $(O1) a2: $(O2) diff --git a/src/lib/os/proc.go b/src/lib/os/proc_darwin.go index bae977b1f..bae977b1f 100644 --- a/src/lib/os/proc.go +++ b/src/lib/os/proc_darwin.go diff --git a/src/lib/os/proc_linux.go b/src/lib/os/proc_linux.go new file mode 100644 index 000000000..a802284f3 --- /dev/null +++ b/src/lib/os/proc_linux.go @@ -0,0 +1,20 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package os + +import ( + "os"; + "syscall"; +) + +var Args []string; // provided by runtime +var Envs []string; // provided by runtime + +// Exit causes the current program to exit with the given status code. +// Conventionally, code zero indicates success, non-zero an error. +func Exit(code int) { + syscall.Syscall(syscall.SYS_EXIT_GROUP, int64(code), 0, 0) +} + |