Skip to content

x/sys/unix: add missing values from syscall pkg to enable complete migration #19697

@laboger

Description

@laboger

Please answer these questions before submitting your issue. Thanks!

What version of Go are you using (go version)?

go tip

What operating system and processor architecture are you using (go env)?

Ubuntu 16.04 and Fedora22, Red Hat 7.x on ppc64le & ppc64

What did you do?

Trying to migrate Go code from syscall to sys/unix as described in the golang syscall package documentation https://golang.org/pkg/syscall/. This was the suggested solution for issue #19560. While it is possible to fix just the case that is described in this issue, that is not a complete solution. We want to avoid hitting another issue because of using syscall, so we'd like to migrate use of syscall to sys/unix. Also having a mixture of references to syscall and sys/unix is confusing since then it is not clear when to use which one.

Issues with migrating from syscall to sys/unix:

  1. syscall.Signal and syscall.Errno need to have a type defined within sys/unix so user code doesn't need to use these to convert signals and errnos to the appropriate integer type for the platform.

I was going to try a change for this based on a suggestion by Ian, but I'm not able to get the generator scripts in sys/unix to work. I get these errors:

GOOS=linux GOARCH=ppc64le ./mkall.sh
could not determine kind of name for C.TIOCGETC
could not determine kind of name for C.TIOCGETP
could not determine kind of name for C.TIOCGLTC
could not determine kind of name for C.TIOCSETC
could not determine kind of name for C.TIOCSETN
could not determine kind of name for C.TIOCSETP
could not determine kind of name for C.TIOCSLTC

This happened on Fedora22 and Ubuntu 16.04. If I could get some direction on what this might be that would help.

  1. The structure SysProcAttr is defined in syscall but not in sys/unix. It is used in the os package, so I don't think it should be moved to sys/unix. Seems like it needs an equivalent declaration in os.

Metadata

Metadata

Assignees

No one assigned

    Labels

    compiler/runtimeIssues related to the Go compiler and/or runtime.

    Type

    No type

    Projects

    Status

    Triage Backlog

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions