mirror of
https://github.com/rwinkhart/sys.git
synced 2026-09-02 07:07:33 -04:00
unix: remove runtime.KeepAlive calls for Linux ioctl wrappers
As of CL 340915 these should no longer be necessary. Change-Id: I644595aa0594d3bdc9b8f2c349990e0311060fd6 Reviewed-on: https://go-review.googlesource.com/c/sys/+/340951 Trust: Matt Layher <mdlayher@gmail.com> Run-TryBot: Matt Layher <mdlayher@gmail.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
This commit is contained in:
+4
-14
@@ -5,7 +5,6 @@
|
|||||||
package unix
|
package unix
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"runtime"
|
|
||||||
"unsafe"
|
"unsafe"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -33,9 +32,7 @@ func IoctlGetRTCTime(fd int) (*RTCTime, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func IoctlSetRTCTime(fd int, value *RTCTime) error {
|
func IoctlSetRTCTime(fd int, value *RTCTime) error {
|
||||||
err := ioctlPtr(fd, RTC_SET_TIME, unsafe.Pointer(value))
|
return ioctlPtr(fd, RTC_SET_TIME, unsafe.Pointer(value))
|
||||||
runtime.KeepAlive(value)
|
|
||||||
return err
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func IoctlGetRTCWkAlrm(fd int) (*RTCWkAlrm, error) {
|
func IoctlGetRTCWkAlrm(fd int) (*RTCWkAlrm, error) {
|
||||||
@@ -45,9 +42,7 @@ func IoctlGetRTCWkAlrm(fd int) (*RTCWkAlrm, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func IoctlSetRTCWkAlrm(fd int, value *RTCWkAlrm) error {
|
func IoctlSetRTCWkAlrm(fd int, value *RTCWkAlrm) error {
|
||||||
err := ioctlPtr(fd, RTC_WKALM_SET, unsafe.Pointer(value))
|
return ioctlPtr(fd, RTC_WKALM_SET, unsafe.Pointer(value))
|
||||||
runtime.KeepAlive(value)
|
|
||||||
return err
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// IoctlGetEthtoolDrvinfo fetches ethtool driver information for the network
|
// IoctlGetEthtoolDrvinfo fetches ethtool driver information for the network
|
||||||
@@ -62,7 +57,6 @@ func IoctlGetEthtoolDrvinfo(fd int, ifname string) (*EthtoolDrvinfo, error) {
|
|||||||
ifrd := ifr.SetData(unsafe.Pointer(&value))
|
ifrd := ifr.SetData(unsafe.Pointer(&value))
|
||||||
|
|
||||||
err = ioctlPtr(fd, SIOCETHTOOL, unsafe.Pointer(&ifrd))
|
err = ioctlPtr(fd, SIOCETHTOOL, unsafe.Pointer(&ifrd))
|
||||||
runtime.KeepAlive(ifrd)
|
|
||||||
return &value, err
|
return &value, err
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -87,9 +81,7 @@ func IoctlWatchdogKeepalive(fd int) error {
|
|||||||
// range of data conveyed in value to the file associated with the file
|
// range of data conveyed in value to the file associated with the file
|
||||||
// descriptor destFd. See the ioctl_ficlonerange(2) man page for details.
|
// descriptor destFd. See the ioctl_ficlonerange(2) man page for details.
|
||||||
func IoctlFileCloneRange(destFd int, value *FileCloneRange) error {
|
func IoctlFileCloneRange(destFd int, value *FileCloneRange) error {
|
||||||
err := ioctlPtr(destFd, FICLONERANGE, unsafe.Pointer(value))
|
return ioctlPtr(destFd, FICLONERANGE, unsafe.Pointer(value))
|
||||||
runtime.KeepAlive(value)
|
|
||||||
return err
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// IoctlFileClone performs an FICLONE ioctl operation to clone the entire file
|
// IoctlFileClone performs an FICLONE ioctl operation to clone the entire file
|
||||||
@@ -158,9 +150,7 @@ func IoctlFileDedupeRange(srcFd int, value *FileDedupeRange) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func IoctlHIDGetDesc(fd int, value *HIDRawReportDescriptor) error {
|
func IoctlHIDGetDesc(fd int, value *HIDRawReportDescriptor) error {
|
||||||
err := ioctlPtr(fd, HIDIOCGRDESC, unsafe.Pointer(value))
|
return ioctlPtr(fd, HIDIOCGRDESC, unsafe.Pointer(value))
|
||||||
runtime.KeepAlive(value)
|
|
||||||
return err
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func IoctlHIDGetRawInfo(fd int) (*HIDRawDevInfo, error) {
|
func IoctlHIDGetRawInfo(fd int) (*HIDRawDevInfo, error) {
|
||||||
|
|||||||
Reference in New Issue
Block a user