Bug 230736 - lang/go: Missing system calls in the "syscall" module
Summary: lang/go: Missing system calls in the "syscall" module
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Julien Laffaye
URL: https://github.com/golang/go/issues/2...
Keywords:
Depends on:
Blocks:
 
Reported: 2018-08-18 17:53 UTC by Yuri Victorovich
Modified: 2018-08-19 13:16 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (jlaffaye)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Yuri Victorovich freebsd_committer freebsd_triage 2018-08-18 17:53:26 UTC
This code:
> package headers
>   
> import "syscall"
> 
> var IpccallLookup = map[int]string{
>         syscall.SYS_SEMOP:  "semop",
>         syscall.SYS_SEMGET: "semget",
>         syscall.SYS_SEMCTL: "semctl",
>         4:                  "semtimedop",
>         syscall.SYS_MSGSND: "msgsnd",
>         syscall.SYS_MSGRCV: "msgrcv",
>         syscall.SYS_MSGGET: "msgget",
>         syscall.SYS_MSGCTL: "msgctl",
>         syscall.SYS_SHMAT:  "shmat",
>         syscall.SYS_SHMDT:  "shmdt",
>         syscall.SYS_SHMGET: "shmget",
>         syscall.SYS_SHMCTL: "shmctl",
> }

Fails to build even though these syscalls exist in the system:
> ../go/src/github.com/mozilla/mig/vendor/github.com/mozilla/libaudit-go/headers/ipc_tab.go:7:2: undefined: syscall.SYS_SEMOP
> ../go/src/github.com/mozilla/mig/vendor/github.com/mozilla/libaudit-go/headers/ipc_tab.go:8:2: undefined: syscall.SYS_SEMGET
> ../go/src/github.com/mozilla/mig/vendor/github.com/mozilla/libaudit-go/headers/ipc_tab.go:9:2: undefined: syscall.SYS_SEMCTL
> ../go/src/github.com/mozilla/mig/vendor/github.com/mozilla/libaudit-go/headers/ipc_tab.go:11:2: undefined: syscall.SYS_MSGSND
> ../go/src/github.com/mozilla/mig/vendor/github.com/mozilla/libaudit-go/headers/ipc_tab.go:12:2: undefined: syscall.SYS_MSGRCV
> ../go/src/github.com/mozilla/mig/vendor/github.com/mozilla/libaudit-go/headers/ipc_tab.go:13:2: undefined: syscall.SYS_MSGGET
> ../go/src/github.com/mozilla/mig/vendor/github.com/mozilla/libaudit-go/headers/ipc_tab.go:14:2: undefined: syscall.SYS_MSGCTL
> ../go/src/github.com/mozilla/mig/vendor/github.com/mozilla/libaudit-go/headers/ipc_tab.go:15:2: undefined: syscall.SYS_SHMAT
> ../go/src/github.com/mozilla/mig/vendor/github.com/mozilla/libaudit-go/headers/ipc_tab.go:16:2: undefined: syscall.SYS_SHMDT
> ../go/src/github.com/mozilla/mig/vendor/github.com/mozilla/libaudit-go/headers/ipc_tab.go:17:2: undefined: syscall.SYS_SHMGET
> ../go/src/github.com/mozilla/mig/vendor/github.com/mozilla/libaudit-go/headers/ipc_tab.go:17:2: too many errors

go-1.10.3
Comment 1 Julien Laffaye freebsd_committer freebsd_triage 2018-08-19 13:16:23 UTC
From the official documentation:
NOTE: This package is locked down. Code outside the standard Go repository should be migrated to use the corresponding package in the golang.org/x/sys repository. That is also where updates required by new systems or versions should be applied. Signal, Errno and SysProcAttr are not yet available in golang.org/x/sys and must still be referenced from the syscall package. See https://golang.org/s/go1.4-syscall for more information.

Syscalls are maintained outside the go standard packages, this is out of the scope of the lang/go port.