On Wed, Aug 15, 2018 at 11:07 AM, Peter Morjan <pmor...@gmail.com> wrote:
>
> https://godoc.org/golang.org/x/sys/unix#IoctlSetInt
>
> func IoctlSetInt(fd int, req uint, value int) error
>
>
> From the function definition and function description I would expect that
> the last parameter "value" can be a regular int value.
> But it actually requires an uintptr of an unsafe.Pointer.  E.g.
> int(uintptr(unsafe.Pointer(&i))
> Or am I wrong?

You have to know the behavior of the ioctl code in order to know which
function to use.  You should use `IoctlSetInt` for ioctls that take an
integer value, such as `TCSBRK`.  For an ioctl that takes a `*int`
argument, you should be using `IoctlGetInt`.

Ian

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to