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

proposal: syscall: implement Flock on Solaris in terms of FcntlFlock #24684

Closed
ppbrown opened this issue Apr 4, 2018 · 2 comments
Closed

proposal: syscall: implement Flock on Solaris in terms of FcntlFlock #24684

ppbrown opened this issue Apr 4, 2018 · 2 comments
Labels
FrozenDueToAge NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made. Proposal
Milestone

Comments

@ppbrown
Copy link

ppbrown commented Apr 4, 2018

go version go1.10.1 solaris/amd64

okay I read that
"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"
I get it. You dont want new stuff there.

That being said, programs are still going to be using syscall.Flock for years to come
Solaris doesnt have a Flock implementation, because current common implementation just uses Syscall(), which solaris doesnt exactly have.

But it DOES have FcntlFlock.

So would it be permissible for me to submit a patch to syscall_solaris.go, that gives Solaris an implementation of Flock on top of FcntlFlock ?

@ppbrown ppbrown changed the title syscall: Permissible to bring Solaris into parity, add Flock ? syscall: Permissible to bring Solaris into parity, upload Flock patch? Apr 4, 2018
@bcmills
Copy link
Contributor

bcmills commented Apr 4, 2018

The syscall package is for operating system primitives. If flock is not a primitive on Solaris, that doesn't seem like a good fit. (In particular, it appears that fcntl differs from flock in some subtle but significant ways.)

The os package contains non‐primitive file operations. Is there a higher‐level file locking API that could fit there? (Is there an analogous API on Windows?)

@bcmills bcmills added the NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made. label Apr 4, 2018
@bcmills bcmills added this to the Unplanned milestone Apr 4, 2018
@bcmills bcmills changed the title syscall: Permissible to bring Solaris into parity, upload Flock patch? proposal: syscall: implement Flock on Solaris in terms of FcntlFlock Apr 4, 2018
@bcmills bcmills modified the milestones: Unplanned, Proposal Apr 4, 2018
@rsc
Copy link
Contributor

rsc commented Apr 9, 2018

implement Flock on Solaris in terms of FcntlFlock

These are two semantically different locking APIs. I don't see why we'd implement one in terms of the other. Syscall is about raw access to the underlying system, not simulations.

In any event, x/sys/unix is the place to add both, and it looks like it already has both.

syscall is frozen, as others have said. We'd only add to syscall if uses within the standard library were affected, and I don't see any.

@rsc rsc closed this as completed Apr 9, 2018
@golang golang locked and limited conversation to collaborators Apr 9, 2019
@golang golang unlocked this conversation Jan 10, 2024
@golang golang locked as resolved and limited conversation to collaborators Jan 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made. Proposal
Projects
None yet
Development

No branches or pull requests

4 participants