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: Select returns (int, error) on linux, but just error elsewhere #11703

Open
mdempsky opened this issue Jul 14, 2015 · 1 comment
Open
Labels
compiler/runtime Issues related to the Go compiler and/or runtime.
Milestone

Comments

@mdempsky
Copy link
Member

Is this inconsistency intentional? Select is a POSIX function and has the same 'int' return value on all supported platforms where it's available, so it seems odd to only expose it on Linux.

(Motivation: I was trying to use github.com/jaracil/poll on OpenBSD, but ironically its Select-based fallback for non-Linux OSes is written assuming the Linux Select API.)

@ianlancetaylor
Copy link
Contributor

This does seem like a bug. We can't change the existing function in the syscall package. I don't know how we feel about changing it in x/sys/unix.

Maybe we need to add a new function to x/sys/unix. Perhaps SelectN. Then we can provide a consistent interface across all Unix OS's. But since syscall is frozen, I don't think we want to change it for this.

@ianlancetaylor ianlancetaylor changed the title syscall, x/sys/unix: Select returns (int, error) on linux, but just error elsewhere x/sys/unix: Select returns (int, error) on linux, but just error elsewhere Jul 14, 2015
@ianlancetaylor ianlancetaylor added this to the Unreleased milestone Jul 14, 2015
@gopherbot gopherbot added the compiler/runtime Issues related to the Go compiler and/or runtime. label Jul 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler/runtime Issues related to the Go compiler and/or runtime.
Projects
Status: Triage Backlog
Development

No branches or pull requests

3 participants