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: add Mmap for Solaris and Illumos? #52875

Open
bcmills opened this issue May 12, 2022 · 4 comments
Open

syscall: add Mmap for Solaris and Illumos? #52875

bcmills opened this issue May 12, 2022 · 4 comments
Labels
NeedsInvestigation OS-illumos OS-Solaris
Milestone

Comments

@bcmills
Copy link
Member

@bcmills bcmills commented May 12, 2022

Solaris supports an mmap syscall.

x/sys/unix.Mmap is defined for GOOS=solaris, and runtime.mmap appears to use the system call as well.

And yet, even though Mmap exists on Solaris and syscall.Mmap exists on most Go Unix ports, for some reason syscall.Mmap does not appear to be defined for GOOS=solaris or GOOS=illumos.

We're looking at possibly using syscall.Mmap in cmd/go in https://go.dev/cl/403975 (CC @matloob). Would it make sense to add syscall.Mmap, syscall.Munmap, and related constants for Solaris and Illumos for consistency with other platforms?

(CC @ianlancetaylor @tklauser @golang/solaris @golang/illumos)

@bcmills bcmills added OS-Solaris NeedsInvestigation labels May 12, 2022
@bcmills bcmills added this to the Backlog milestone May 12, 2022
@ianlancetaylor
Copy link
Contributor

@ianlancetaylor ianlancetaylor commented May 12, 2022

Although the syscall package is frozen, I think that this kind of addition is OK since it matches other targets.

@tklauser
Copy link
Member

@tklauser tklauser commented May 13, 2022

I too think this is OK.

There have been similar additions in the past when a particular function was present in syscall for some, but not all platforms. See e.g. https://go.dev/cl/403394, https://go.dev/cl/391434, https://go.dev/cl/390714 for some recent examples where this was the case for solaris and illumos.

@gopherbot
Copy link

@gopherbot gopherbot commented Jun 21, 2022

Change https://go.dev/cl/413374 mentions this issue: syscall: add Mmap and Munmap on solaris

@gopherbot
Copy link

@gopherbot gopherbot commented Jun 21, 2022

Change https://go.dev/cl/413375 mentions this issue: cmd/go/internal/mmap: use syscall.Mmap on solaris

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsInvestigation OS-illumos OS-Solaris
Projects
None yet
Development

No branches or pull requests

4 participants