1
0
mirror of https://github.com/golang/go synced 2024-11-20 05:44:44 -07:00

syscall: cleanly exit all Go procs on Plan 9

syscall.Exit would originally kill only the calling
Go proc, leaving behind other procs in the
same group. This change makes syscall.Exit call
runtime·exit, which due to CL
https://golang.org/cl/5617048
will cleanly exit all the Go procs in the group.

R=golang-dev, rsc, rminnich, remyoudompheng, ality, john
CC=golang-dev, mirtchovski
https://golang.org/cl/6036051
This commit is contained in:
Akshat Kumar 2012-04-19 16:31:26 -07:00 committed by Anthony Martin
parent fca32f02e9
commit 49a7da2dd9
2 changed files with 11 additions and 16 deletions

View File

@ -149,3 +149,11 @@ copyresult6:
MOVSL MOVSL
MOVSL MOVSL
RET RET
//func exit(code int)
// Import runtime·exit for cleanly exiting.
TEXT ·exit(SB),7,$4
MOVL code+0(FP), AX
MOVL AX, 0(SP)
CALL runtime·exit(SB)
RET

View File

@ -69,23 +69,10 @@ func errstr() string {
func Getpagesize() int { return 4096 } func Getpagesize() int { return 4096 }
//sys exits(msg *byte) // Implemented in assembly to import from runtime.
func Exits(msg *string) { func exit(int)
if msg == nil {
exits(nil)
}
exits(StringBytePtr(*msg)) func Exit(code int) { exit(code) }
}
func Exit(code int) {
if code == 0 {
Exits(nil)
}
msg := itoa(code)
Exits(&msg)
}
func readnum(path string) (uint, error) { func readnum(path string) (uint, error) {
var b [12]byte var b [12]byte