Skip to content

x/sys: the IoctlSetPointerInt function should be available on macOS and BSD platforms #40986

Description

@krader1961

Function unix.IoctlSetPointerInt should be available on all supported UNIX like systems.

I've been contributing to the Elvish shell project and recently attempted to replace it's custom Ioctl() function (because it had no unit tests) with functionality provided by golang.org/x/sys. However, one of the ioctl's Elvish uses is unix.TIOCSPGRP which requires using unix.IoctlSetPointerInt(). That transformation works fine on Linux but fails to build on macOS and FreeBSD with "undefined: unix.IoctlSetPointerInt". This is because unix.IoctlSetPointerInt is only implemented in syscall_linux.go. -- something that is not obvious from looking at the public documentation. I can't see any reason why this particular function can't be implemented generically for every UNIX like OS.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions