From 429f518978ab01db8bb6f44b66785088e7fba58b Mon Sep 17 00:00:00 2001 From: Carlos Eduardo Seo Date: Wed, 20 Sep 2017 18:38:28 -0300 Subject: [PATCH] unix: update Select to use newselect on ppc64x Analog to the runtime package, Select should be using newselect instead of select. This change addresses this problem and regenerates zsyscall_linux_* for ppc64 and ppc64le. Updates golang/go#21946 Change-Id: I7ed5c2490ba2ce556f143f8e8377572ab345f7b8 Reviewed-on: https://go-review.googlesource.com/65091 Run-TryBot: Ian Lance Taylor TryBot-Result: Gobot Gobot Reviewed-by: Lynn Boger --- unix/syscall_linux_ppc64x.go | 2 +- unix/syscall_linux_test.go | 7 +++++++ unix/zsyscall_linux_ppc64.go | 2 +- unix/zsyscall_linux_ppc64le.go | 2 +- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/unix/syscall_linux_ppc64x.go b/unix/syscall_linux_ppc64x.go index 28b7f350..a4a8e4ee 100644 --- a/unix/syscall_linux_ppc64x.go +++ b/unix/syscall_linux_ppc64x.go @@ -28,7 +28,7 @@ package unix //sys Pread(fd int, p []byte, offset int64) (n int, err error) = SYS_PREAD64 //sys Pwrite(fd int, p []byte, offset int64) (n int, err error) = SYS_PWRITE64 //sys Seek(fd int, offset int64, whence int) (off int64, err error) = SYS_LSEEK -//sys Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) +//sys Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) = SYS__NEWSELECT //sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) //sys Setfsgid(gid int) (err error) //sys Setfsuid(uid int) (err error) diff --git a/unix/syscall_linux_test.go b/unix/syscall_linux_test.go index 37702313..c0ab2db9 100644 --- a/unix/syscall_linux_test.go +++ b/unix/syscall_linux_test.go @@ -192,6 +192,13 @@ func TestGetrlimit(t *testing.T) { } } +func TestSelect(t *testing.T) { + _, err := unix.Select(0, nil, nil, nil, &unix.Timeval{0, 0}) + if err != nil { + t.Fatalf("Select: %v", err) + } +} + // utilities taken from os/os_test.go func touch(t *testing.T, name string) { diff --git a/unix/zsyscall_linux_ppc64.go b/unix/zsyscall_linux_ppc64.go index 39eacd63..2a32c6b4 100644 --- a/unix/zsyscall_linux_ppc64.go +++ b/unix/zsyscall_linux_ppc64.go @@ -1734,7 +1734,7 @@ func Seek(fd int, offset int64, whence int) (off int64, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) { - r0, _, e1 := Syscall6(SYS_SELECT, uintptr(nfd), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0) + r0, _, e1 := Syscall6(SYS__NEWSELECT, uintptr(nfd), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) diff --git a/unix/zsyscall_linux_ppc64le.go b/unix/zsyscall_linux_ppc64le.go index 2a79746b..8172d355 100644 --- a/unix/zsyscall_linux_ppc64le.go +++ b/unix/zsyscall_linux_ppc64le.go @@ -1734,7 +1734,7 @@ func Seek(fd int, offset int64, whence int) (off int64, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) { - r0, _, e1 := Syscall6(SYS_SELECT, uintptr(nfd), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0) + r0, _, e1 := Syscall6(SYS__NEWSELECT, uintptr(nfd), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1)