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

x/sys/unix: missing SYS_MSYNC for NetBSD #18513

Closed
Artoria2e5 opened this issue Jan 4, 2017 · 4 comments
Closed

x/sys/unix: missing SYS_MSYNC for NetBSD #18513

Artoria2e5 opened this issue Jan 4, 2017 · 4 comments
Labels
FrozenDueToAge OS-NetBSD Suggested Issues that may be good for new contributors looking for work to do.
Milestone

Comments

@Artoria2e5
Copy link

Artoria2e5 commented Jan 4, 2017

Please answer these questions before submitting your issue. Thanks!

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

Problem exists on HEAD.

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

Let's pretend I am using NetBSD.

What did you do?

A few days ago I somehow saw edsrdf's mmap-go, which self-defines an syscall number for SYS_MSYNC (277) on NetBSD. Apparently Go's current syscall extraction fails to find it in NetBSD headers.

For cross-check I looked at syscalls.master, which also points to 277 as msync:

277	STD 		{ int|sys|13|msync(void *addr, size_t len, int flags); }

What did you expect to see?

Proper SYS_MSYNC.

What did you see instead?

It doesn't exist.

@bradfitz
Copy link
Contributor

bradfitz commented Jan 4, 2017

The Go syscall package is frozen. See https://golang.org/pkg/syscall/#pkg-overview

We can repurpose this bug for the https://godoc.org/golang.org/x/sys/unix package, though.

@bradfitz bradfitz changed the title Missing SYS_MSYNC for NetBSD x/sys/unix: missing SYS_MSYNC for NetBSD Jan 4, 2017
@bradfitz bradfitz added OS-NetBSD Suggested Issues that may be good for new contributors looking for work to do. labels Jan 4, 2017
@bradfitz bradfitz added this to the Unreleased milestone Jan 5, 2017
@minux
Copy link
Member

minux commented Jan 5, 2017 via email

@LionNatsu
Copy link
Contributor

@minix Yes you are right. I forgot to turn on my lovely local DNS, embarrassing...

@gopherbot
Copy link

Change https://golang.org/cl/56172 mentions this issue: unix: unify memory functions on BSD

micanzhang pushed a commit to micanzhang/sys that referenced this issue Sep 12, 2017
Make Madvice, Mlock, Mlockall, Mprotect, Msync, Munlock and Munlockall
available equally on all BSD flavors. NetBSD was previously lacking
SYS_MSYNC, so add it.

Reorder the //sys function prototype alphabetically and clean up already
implemented syscalls everywhere.

Also add tests for Mprotect, Msync and Madvice - now that they're
available on all unix platforms.

Fixes golang/go#18513

Change-Id: I0eb502d72c7e991f191fb96225ef04e8297d8b8d
Reviewed-on: https://go-review.googlesource.com/56172
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
@golang golang locked and limited conversation to collaborators Aug 17, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge OS-NetBSD Suggested Issues that may be good for new contributors looking for work to do.
Projects
None yet
Development

No branches or pull requests

5 participants