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 <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Lynn Boger <laboger@linux.vnet.ibm.com>
This commit is contained in:
Carlos Eduardo Seo 2017-09-20 18:38:28 -03:00 коммит произвёл Lynn Boger
Родитель 2320a9c158
Коммит 429f518978
4 изменённых файлов: 10 добавлений и 3 удалений

Просмотреть файл

@ -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)

Просмотреть файл

@ -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) {

Просмотреть файл

@ -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)

Просмотреть файл

@ -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)