mirror of
https://github.com/golang/sys.git
synced 2026-02-08 19:56:04 +03:00
unix: expose ioctl returns with ioctlRet on solaris and illumos
Change-Id: Ide2beea5182b3ef35f1f04f429dc8f9327457c8d Reviewed-on: https://go-review.googlesource.com/c/sys/+/302829 Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com> Reviewed-by: David Anderson <dave@natulte.net> Trust: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
committed by
Tobias Klauser
parent
c4fcb01b22
commit
193893d61a
@@ -565,7 +565,12 @@ func Minor(dev uint64) uint32 {
|
||||
* Expose the ioctl function
|
||||
*/
|
||||
|
||||
//sys ioctl(fd int, req uint, arg uintptr) (err error)
|
||||
//sys ioctlRet(fd int, req uint, arg uintptr) (ret int, err error) = libc.ioctl
|
||||
|
||||
func ioctl(fd int, req uint, arg uintptr) (err error) {
|
||||
_, err = ioctlRet(fd, req, arg)
|
||||
return err
|
||||
}
|
||||
|
||||
func IoctlSetTermio(fd int, req uint, value *Termio) error {
|
||||
err := ioctl(fd, req, uintptr(unsafe.Pointer(value)))
|
||||
|
||||
@@ -619,8 +619,9 @@ func __minor(version int, dev uint64) (val uint) {
|
||||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func ioctl(fd int, req uint, arg uintptr) (err error) {
|
||||
_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procioctl)), 3, uintptr(fd), uintptr(req), uintptr(arg), 0, 0, 0)
|
||||
func ioctlRet(fd int, req uint, arg uintptr) (ret int, err error) {
|
||||
r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procioctl)), 3, uintptr(fd), uintptr(req), uintptr(arg), 0, 0, 0)
|
||||
ret = int(r0)
|
||||
if e1 != 0 {
|
||||
err = e1
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user