mirror of
https://github.com/rwinkhart/sys.git
synced 2026-09-06 09:07:16 -04:00
unix: add Select on Solaris
Change-Id: I9e0e4bc6b9f8700d72e891d623f948db6af7d64b Reviewed-on: https://go-review.googlesource.com/85255 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
d818ba11af
commit
801364e02a
@@ -95,6 +95,7 @@ import (
|
||||
//go:cgo_import_dynamic libc_renameat renameat "libc.so"
|
||||
//go:cgo_import_dynamic libc_rmdir rmdir "libc.so"
|
||||
//go:cgo_import_dynamic libc_lseek lseek "libc.so"
|
||||
//go:cgo_import_dynamic libc_select select "libc.so"
|
||||
//go:cgo_import_dynamic libc_setegid setegid "libc.so"
|
||||
//go:cgo_import_dynamic libc_seteuid seteuid "libc.so"
|
||||
//go:cgo_import_dynamic libc_setgid setgid "libc.so"
|
||||
@@ -220,6 +221,7 @@ import (
|
||||
//go:linkname procRenameat libc_renameat
|
||||
//go:linkname procRmdir libc_rmdir
|
||||
//go:linkname proclseek libc_lseek
|
||||
//go:linkname procSelect libc_select
|
||||
//go:linkname procSetegid libc_setegid
|
||||
//go:linkname procSeteuid libc_seteuid
|
||||
//go:linkname procSetgid libc_setgid
|
||||
@@ -346,6 +348,7 @@ var (
|
||||
procRenameat,
|
||||
procRmdir,
|
||||
proclseek,
|
||||
procSelect,
|
||||
procSetegid,
|
||||
procSeteuid,
|
||||
procSetgid,
|
||||
@@ -1264,6 +1267,14 @@ func Seek(fd int, offset int64, whence int) (newoffset int64, err error) {
|
||||
return
|
||||
}
|
||||
|
||||
func Select(n int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (err error) {
|
||||
_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procSelect)), 5, uintptr(n), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0)
|
||||
if e1 != 0 {
|
||||
err = e1
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func Setegid(egid int) (err error) {
|
||||
_, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procSetegid)), 1, uintptr(egid), 0, 0, 0, 0, 0)
|
||||
if e1 != 0 {
|
||||
|
||||
Reference in New Issue
Block a user