mirror of
https://github.com/rwinkhart/sys.git
synced 2026-09-01 06:46:44 -04:00
unix: use ppoll to implement Pause on linux/{arm64,riscv64}
Use ppoll instead of re-implementing it using Syscall6(SYS_PPOLL, ...) Change-Id: I7b3baa00df32dc1fe7ee80755843a492a884938c Reviewed-on: https://go-review.googlesource.com/c/144171 Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
committed by
Tobias Klauser
parent
22bddfe262
commit
5cd93ef61a
@@ -191,12 +191,9 @@ func Dup2(oldfd int, newfd int) (err error) {
|
|||||||
return Dup3(oldfd, newfd, 0)
|
return Dup3(oldfd, newfd, 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
func Pause() (err error) {
|
func Pause() error {
|
||||||
_, _, e1 := Syscall6(SYS_PPOLL, 0, 0, 0, 0, 0, 0)
|
_, err := ppoll(nil, 0, nil, nil)
|
||||||
if e1 != 0 {
|
return err
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func Poll(fds []PollFd, timeout int) (n int, err error) {
|
func Poll(fds []PollFd, timeout int) (n int, err error) {
|
||||||
|
|||||||
@@ -191,12 +191,9 @@ func Dup2(oldfd int, newfd int) (err error) {
|
|||||||
return Dup3(oldfd, newfd, 0)
|
return Dup3(oldfd, newfd, 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
func Pause() (err error) {
|
func Pause() error {
|
||||||
_, _, e1 := Syscall6(SYS_PPOLL, 0, 0, 0, 0, 0, 0)
|
_, err := ppoll(nil, 0, nil, nil)
|
||||||
if e1 != 0 {
|
return err
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func Poll(fds []PollFd, timeout int) (n int, err error) {
|
func Poll(fds []PollFd, timeout int) (n int, err error) {
|
||||||
|
|||||||
Reference in New Issue
Block a user