1
0
mirror of https://github.com/golang/go synced 2024-11-13 19:10:22 -07:00

syscall: on freebsd, darwin, give Kill same signature as on linux

R=r, cw
CC=golang-dev
https://golang.org/cl/201043
This commit is contained in:
Russ Cox 2010-02-04 02:06:08 -08:00
parent ea344e123a
commit f2317d3ec1
6 changed files with 12 additions and 6 deletions

View File

@ -454,6 +454,10 @@ func SysctlUint32(name string) (value uint32, errno int) {
return *(*uint32)(unsafe.Pointer(&buf[0])), 0 return *(*uint32)(unsafe.Pointer(&buf[0])), 0
} }
//sys kill(pid int, signum int, posix int) (errno int)
func Kill(pid int, signum int) (errno int) { return kill(pid, signum, 1) }
// TODO: wrap // TODO: wrap
// Acct(name nil-string) (errno int) // Acct(name nil-string) (errno int)
// Futimes(fd int, timeval *Timeval) (errno int) // Pointer to 2 timevals! // Futimes(fd int, timeval *Timeval) (errno int) // Pointer to 2 timevals!
@ -511,7 +515,6 @@ func SysctlUint32(name string) (value uint32, errno int) {
//sys Getsid(pid int) (sid int, errno int) //sys Getsid(pid int) (sid int, errno int)
//sys Getuid() (uid int) //sys Getuid() (uid int)
//sys Issetugid() (tainted bool) //sys Issetugid() (tainted bool)
//sys Kill(pid int, signum int, posix int) (errno int)
//sys Kqueue() (fd int, errno int) //sys Kqueue() (fd int, errno int)
//sys Lchown(path string, uid int, gid int) (errno int) //sys Lchown(path string, uid int, gid int) (errno int)
//sys Link(path string, link string) (errno int) //sys Link(path string, link string) (errno int)

View File

@ -454,6 +454,10 @@ func SysctlUint32(name string) (value uint32, errno int) {
return *(*uint32)(unsafe.Pointer(&buf[0])), 0 return *(*uint32)(unsafe.Pointer(&buf[0])), 0
} }
//sys kill(pid int, signum int, posix int) (errno int)
func Kill(pid int, signum int) (errno int) { return kill(pid, signum, 1) }
// TODO: wrap // TODO: wrap
// Acct(name nil-string) (errno int) // Acct(name nil-string) (errno int)
// Futimes(fd int, timeval *Timeval) (errno int) // Pointer to 2 timevals! // Futimes(fd int, timeval *Timeval) (errno int) // Pointer to 2 timevals!
@ -511,7 +515,6 @@ func SysctlUint32(name string) (value uint32, errno int) {
//sys Gettimeofday(tv *Timeval) (errno int) //sys Gettimeofday(tv *Timeval) (errno int)
//sys Getuid() (uid int) //sys Getuid() (uid int)
//sys Issetugid() (tainted bool) //sys Issetugid() (tainted bool)
//sys Kill(pid int, signum int, posix int) (errno int)
//sys Kqueue() (fd int, errno int) //sys Kqueue() (fd int, errno int)
//sys Lchown(path string, uid int, gid int) (errno int) //sys Lchown(path string, uid int, gid int) (errno int)
//sys Link(path string, link string) (errno int) //sys Link(path string, link string) (errno int)

View File

@ -370,7 +370,7 @@ func Issetugid() (tainted bool) {
return return
} }
func Kill(pid int, signum int, posix int) (errno int) { func kill(pid int, signum int, posix int) (errno int) {
_, _, e1 := Syscall(SYS_KILL, uintptr(pid), uintptr(signum), uintptr(posix)) _, _, e1 := Syscall(SYS_KILL, uintptr(pid), uintptr(signum), uintptr(posix))
errno = int(e1) errno = int(e1)
return return

View File

@ -370,7 +370,7 @@ func Issetugid() (tainted bool) {
return return
} }
func Kill(pid int, signum int, posix int) (errno int) { func kill(pid int, signum int, posix int) (errno int) {
_, _, e1 := Syscall(SYS_KILL, uintptr(pid), uintptr(signum), uintptr(posix)) _, _, e1 := Syscall(SYS_KILL, uintptr(pid), uintptr(signum), uintptr(posix))
errno = int(e1) errno = int(e1)
return return

View File

@ -370,7 +370,7 @@ func Issetugid() (tainted bool) {
return return
} }
func Kill(pid int, signum int, posix int) (errno int) { func kill(pid int, signum int, posix int) (errno int) {
_, _, e1 := Syscall(SYS_KILL, uintptr(pid), uintptr(signum), uintptr(posix)) _, _, e1 := Syscall(SYS_KILL, uintptr(pid), uintptr(signum), uintptr(posix))
errno = int(e1) errno = int(e1)
return return

View File

@ -370,7 +370,7 @@ func Issetugid() (tainted bool) {
return return
} }
func Kill(pid int, signum int, posix int) (errno int) { func kill(pid int, signum int, posix int) (errno int) {
_, _, e1 := Syscall(SYS_KILL, uintptr(pid), uintptr(signum), uintptr(posix)) _, _, e1 := Syscall(SYS_KILL, uintptr(pid), uintptr(signum), uintptr(posix))
errno = int(e1) errno = int(e1)
return return