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: mmap constants missing on netbsd, openbsd #4929

Closed
cookieo9 opened this issue Feb 27, 2013 · 14 comments
Closed

syscall: mmap constants missing on netbsd, openbsd #4929

cookieo9 opened this issue Feb 27, 2013 · 14 comments

Comments

@cookieo9
Copy link
Contributor

The PROT_* and MAP_* constants are not in the zerrors_*bsd_*.go files (generated by
mkerrors.sh).

This makes it difficult to use the Sycall.Mmap function on the BSDs. Darwin & linux
both have these constants defined, and their calls of the mkerrors.sh script include the
sys/mman.h header file (where those constants usually live), while the *bsd ones don't.

This code works on darwin, and cross-compiles to linux (not tested), but fails to
compile on freebsd, netbsd or openbsd: http://play.golang.org/p/miYUOmOk22
@cookieo9
Copy link
Contributor Author

Comment 1:

Additional notes for the issue.
1) My language may not be perfectly clear about where I've seen this issue. On my darwin
machine the code compiles correctly (386/amd64). When I use a cross compiler, then I've
gotten the code to compile for linux (386/amd64/arm). For all the *bsds the
cross-compiler choked on the PROT_READ and MAP_PRIVATE symbols, and nothing else (not
the Mmap call itself). I also installed freebsd 9.1 64-bit on a virtual machine to check
more directly, and failed identically to the cross-compiler:
./mmap.go:23: undefined: syscall.PROT_READ
./mmap.go:23: undefined: syscall.MAP_PRIVATE
These results are backed up by my cursory look into the zerrors_*.go files.
2) On my VM I tried to rebuild the z*.go files using the mkall.sh script. Even without
changing any files at all I get out z*.go files which are different than the ones
checked into the repository, and more importantly, syscall then fails to build. The most
likely reason is because my freebsd version (9.1) has C headers significantly enough
different to cause the resulting files to be broken. This is not terribly relevant to
the issue, except that I was trying to solve the issue myself (and post a CL), but this
development suggests that any solution I come up with may break other people's code in
unexpected ways, and I don't feel my *bsd skills are up to the task.

@davecheney
Copy link
Contributor

Comment 2:

On it.

Owner changed to @davecheney.

Status changed to Accepted.

@davecheney
Copy link
Contributor

Comment 3:

https://golang.org/cl/7432046/

Status changed to Started.

@davecheney
Copy link
Contributor

Comment 4:

This issue was updated by revision 9dd92d5.

Regenerated from FreeBSD-9.1 for amd64 and 386, FreeBSD-CURRENT for arm.
R=devon.odell, minux.ma, rsc
CC=golang-dev
https://golang.org/cl/7438053

@rsc
Copy link
Contributor

rsc commented Mar 12, 2013

Comment 5:

[The time for maybe has passed.]

Labels changed: removed go1.1maybe.

@davecheney
Copy link
Contributor

Comment 6:

The change window for 1.1 is closed. There is still more to be done on this ticket once
1.2 opens up for commits.

Labels changed: added priority-later, go1.2, removed priority-triage.

Owner changed to ---.

Status changed to Accepted.

@minux
Copy link
Member

minux commented Mar 25, 2013

Comment 7:

Labels changed: added go1.2, removed go1.2.

@rsc
Copy link
Contributor

rsc commented Jul 30, 2013

Comment 8:

If there's more to do let's do it.

@bradfitz
Copy link
Contributor

bradfitz commented Sep 4, 2013

Comment 9:

Removing Go 1.2 label.  FreeBSD is done, but NetBSD and OpenBSD aren't.  Those users can
build from Go tip if these files are regenerated there later.

Labels changed: removed go1.2.

@rsc
Copy link
Contributor

rsc commented Nov 27, 2013

Comment 10:

Labels changed: added go1.3maybe.

@4a6f656c
Copy link
Contributor

4a6f656c commented Dec 2, 2013

Comment 11:

Owner changed to @4a6f656c.

@rsc
Copy link
Contributor

rsc commented Dec 4, 2013

Comment 12:

Labels changed: added release-none, removed go1.3maybe.

@rsc
Copy link
Contributor

rsc commented Dec 4, 2013

Comment 13:

Labels changed: added repo-main.

@4a6f656c
Copy link
Contributor

Comment 14:

This issue was closed by revision f40dd8f.

Status changed to Fixed.

@golang golang locked and limited conversation to collaborators Jun 24, 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

7 participants