mirror of
https://github.com/golang/go
synced 2024-11-22 00:34:40 -07:00
syscall: match linux Setsid function signature to darwin
SETSID does return an errno - any reason why it has been done this way in zsyscall_linux_* ? Otherwise it should be the same as darwin. From SETSID(2) on my Linux box: ERRORS On error, -1 is returned, and errno is set. Fixes #730 R=rsc CC=golang-dev https://golang.org/cl/878047
This commit is contained in:
parent
57e764171c
commit
3ffbd57b94
@ -591,7 +591,7 @@ func PtraceDetach(pid int) (errno int) { return ptrace(PTRACE_DETACH, pid, 0, 0)
|
||||
//sys Sethostname(p []byte) (errno int)
|
||||
//sys Setpgid(pid int, pgid int) (errno int)
|
||||
//sys Setrlimit(resource int, rlim *Rlimit) (errno int)
|
||||
//sys Setsid() (pid int)
|
||||
//sys Setsid() (pid int, errno int)
|
||||
//sys Settimeofday(tv *Timeval) (errno int)
|
||||
//sys Setuid(uid int) (errno int)
|
||||
//sys Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, errno int)
|
||||
|
@ -434,9 +434,10 @@ func Setrlimit(resource int, rlim *Rlimit) (errno int) {
|
||||
return
|
||||
}
|
||||
|
||||
func Setsid() (pid int) {
|
||||
r0, _, _ := Syscall(SYS_SETSID, 0, 0, 0)
|
||||
func Setsid() (pid int, errno int) {
|
||||
r0, _, e1 := Syscall(SYS_SETSID, 0, 0, 0)
|
||||
pid = int(r0)
|
||||
errno = int(e1)
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -434,9 +434,10 @@ func Setrlimit(resource int, rlim *Rlimit) (errno int) {
|
||||
return
|
||||
}
|
||||
|
||||
func Setsid() (pid int) {
|
||||
r0, _, _ := Syscall(SYS_SETSID, 0, 0, 0)
|
||||
func Setsid() (pid int, errno int) {
|
||||
r0, _, e1 := Syscall(SYS_SETSID, 0, 0, 0)
|
||||
pid = int(r0)
|
||||
errno = int(e1)
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -434,9 +434,10 @@ func Setrlimit(resource int, rlim *Rlimit) (errno int) {
|
||||
return
|
||||
}
|
||||
|
||||
func Setsid() (pid int) {
|
||||
r0, _, _ := Syscall(SYS_SETSID, 0, 0, 0)
|
||||
func Setsid() (pid int, errno int) {
|
||||
r0, _, e1 := Syscall(SYS_SETSID, 0, 0, 0)
|
||||
pid = int(r0)
|
||||
errno = int(e1)
|
||||
return
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user