mirror of
https://github.com/golang/sys.git
synced 2026-02-08 11:46:04 +03:00
unix: use Getpgid to emulate Getpgrp on linux
Some Linux architectures (e.g. arm64) don't have the getpgrp syscall, use getpgid(0) to emulate it. Update golang/go#10150. This brings CL 8022 that has been applied to the syscall package to x/sys. Change-Id: I24c6d7e8b5b2f075ca4e68b142b2e03ab8a43342 Signed-off-by: Shenghou Ma <minux@golang.org> Reviewed-on: https://go-review.googlesource.com/8023 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
@@ -810,7 +810,12 @@ func Mount(source string, target string, fstype string, flags uintptr, data stri
|
||||
//sys Fsync(fd int) (err error)
|
||||
//sys Getdents(fd int, buf []byte) (n int, err error) = SYS_GETDENTS64
|
||||
//sysnb Getpgid(pid int) (pgid int, err error)
|
||||
//sysnb Getpgrp() (pid int)
|
||||
|
||||
func Getpgrp() (pid int) {
|
||||
pid, _ = Getpgid(0)
|
||||
return
|
||||
}
|
||||
|
||||
//sysnb Getpid() (pid int)
|
||||
//sysnb Getppid() (ppid int)
|
||||
//sys Getpriority(which int, who int) (prio int, err error)
|
||||
|
||||
@@ -542,14 +542,6 @@ func Getpgid(pid int) (pgid int, err error) {
|
||||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func Getpgrp() (pid int) {
|
||||
r0, _, _ := RawSyscall(SYS_GETPGRP, 0, 0, 0)
|
||||
pid = int(r0)
|
||||
return
|
||||
}
|
||||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func Getpid() (pid int) {
|
||||
r0, _, _ := RawSyscall(SYS_GETPID, 0, 0, 0)
|
||||
pid = int(r0)
|
||||
|
||||
@@ -542,14 +542,6 @@ func Getpgid(pid int) (pgid int, err error) {
|
||||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func Getpgrp() (pid int) {
|
||||
r0, _, _ := RawSyscall(SYS_GETPGRP, 0, 0, 0)
|
||||
pid = int(r0)
|
||||
return
|
||||
}
|
||||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func Getpid() (pid int) {
|
||||
r0, _, _ := RawSyscall(SYS_GETPID, 0, 0, 0)
|
||||
pid = int(r0)
|
||||
|
||||
@@ -542,14 +542,6 @@ func Getpgid(pid int) (pgid int, err error) {
|
||||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func Getpgrp() (pid int) {
|
||||
r0, _, _ := RawSyscall(SYS_GETPGRP, 0, 0, 0)
|
||||
pid = int(r0)
|
||||
return
|
||||
}
|
||||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func Getpid() (pid int) {
|
||||
r0, _, _ := RawSyscall(SYS_GETPID, 0, 0, 0)
|
||||
pid = int(r0)
|
||||
|
||||
Reference in New Issue
Block a user