Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

syscall: missing sockios.h defines #6894

Closed
gopherbot opened this issue Dec 5, 2013 · 7 comments
Closed

syscall: missing sockios.h defines #6894

gopherbot opened this issue Dec 5, 2013 · 7 comments

Comments

@gopherbot
Copy link

by joshpoimboeuf:

The syscall package is missing the Linux SIOCBRADDBR ioctl constant from 
/usr/include/linux/sockios.h .  I'm not sure if Go aims to define all possible
constants, but this one would be useful for upstream Docker
(moby/moby#2992.


What steps will reproduce the problem?
grep -r SIOCBRADDBR <go source>

What is the expected output?
SIOCBRADDBR = 0x89a0

What do you see instead?
nothing

Which compiler are you using (5g, 6g, 8g, gccgo)?
6g

Which operating system are you using?
Linux

Which version are you using?  (run 'go version')
1.2

Please provide any additional information below.
@minux
Copy link
Member

minux commented Dec 5, 2013

Comment 1:

I'm not sure we want to add more to the syscall package which is already a mess.
Why not just add the definition to the docker source code? It's part of Linux
user API, so it's not going to change, and it certainly doesn't have to be in
the syscall package.

@gopherbot
Copy link
Author

Comment 2 by joshpoimboeuf:

That's fine with me.  I had assumed it belonged in the syscall package based on the
other constants already there, but it's not much of a problem to redefine it in docker
instead.

@minux
Copy link
Member

minux commented Dec 5, 2013

Comment 3:

i think we generally only include what's used by the Go standard library
and what is needed to use other part of the syscall package.
The other problem is that, even if we could add it to the syscall package,
you probably don't want to force your user to use Go tip before Go 1.3
is released. And if you use conditional compilation to also support older
Go versions, you need to add the definition to your source code anyway.

Status changed to Unfortunate.

@gopherbot
Copy link
Author

Comment 4 by joshpoimboeuf:

> i think we generally only include what's used by the Go standard library
> and what is needed to use other part of the syscall package.
That doesn't seem to be the case, as a recursive grep of, for example SIOCADDDLCI, shows
no in-tree users:
~/goroot/src/pkg $ grep -r SIOCADDDLCI
syscall/zerrors_linux_amd64.go: SIOCADDDLCI                      = 0x8980
syscall/zerrors_linux_386.go:   SIOCADDDLCI                      = 0x8980
syscall/zerrors_linux_arm.go:   SIOCADDDLCI                      = 0x8980
> The other problem is that, even if we could add it to the syscall package,
> you probably don't want to force your user to use Go tip before Go 1.3
> is released. And if you use conditional compilation to also support older
> Go versions, you need to add the definition to your source code anyway.
I'm not really concerned about this issue, it's no problem to define the constant within
docker in the mean time (or permanently if Go doesn't support it).

@minux
Copy link
Member

minux commented Dec 5, 2013

Comment 5:

that constant was added 3 years ago (https://golang.org/cl/2303043).
After Go 1 is released, we're more strict about adding things to the syscall package.

@gopherbot
Copy link
Author

Comment 6 by joshpoimboeuf:

Thanks for the explanation.  I've decided to just use cgo to include linux/sockios.h to
get the macro directly.

@davecheney
Copy link
Contributor

Comment 7:

That is a massive hammer to crack an egg. Why not use the cgo -defs mode to general the
constants you need then check them into source control ? Check out the z* files in the
syscall package.

@golang golang locked and limited conversation to collaborators Jun 25, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants