]> Cypherpunks repositories - gostls13.git/commitdiff
syscall: match linux Setsid function signature to darwin
authorAndrew Gerrand <adg@golang.org>
Mon, 19 Apr 2010 03:12:11 +0000 (13:12 +1000)
committerAndrew Gerrand <adg@golang.org>
Mon, 19 Apr 2010 03:12:11 +0000 (13:12 +1000)
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

src/pkg/syscall/syscall_linux.go
src/pkg/syscall/zsyscall_linux_386.go
src/pkg/syscall/zsyscall_linux_amd64.go
src/pkg/syscall/zsyscall_linux_arm.go

index 058a76d699536babd438901a3aeb198f3fb1f945..82401ac3d40646ddf86b01cd9d7c44eb7fad65be 100644 (file)
@@ -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)
index 519b52f0edbe02660d65b504ad4c9b99ab98e055..951ed1f14bcd6d1fca104932ca7c75dccf11beda 100644 (file)
@@ -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
 }
 
index 8eba79945251deb2aa2212255cbccd5d9904ef28..030bed26043310d0bb5e8e6574e330737423e623 100644 (file)
@@ -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
 }
 
index bef7148ca63666c5e9d5683e248434d550daa68a..d2ffe6907d3a981ed781c4ac96c1ea42182f97c6 100644 (file)
@@ -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
 }