vendor/golang.org/x/sys/unix/ioctl.go
changeset 256 6d9efbef00a9
parent 251 1c52a0eeb952
child 265 05c40b36d3b2
--- a/vendor/golang.org/x/sys/unix/ioctl.go	Mon Jun 07 20:58:18 2021 +0200
+++ b/vendor/golang.org/x/sys/unix/ioctl.go	Sun Jul 11 10:35:56 2021 +0200
@@ -2,6 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris
 // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris
 
 package unix
@@ -20,6 +21,15 @@
 	return ioctl(fd, req, uintptr(value))
 }
 
+// IoctlSetPointerInt performs an ioctl operation which sets an
+// integer value on fd, using the specified request number. The ioctl
+// argument is called with a pointer to the integer value, rather than
+// passing the integer value directly.
+func IoctlSetPointerInt(fd int, req uint, value int) error {
+	v := int32(value)
+	return ioctl(fd, req, uintptr(unsafe.Pointer(&v)))
+}
+
 // IoctlSetWinsize performs an ioctl on fd with a *Winsize argument.
 //
 // To change fd's window size, the req argument should be TIOCSWINSZ.