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

Comments

@mdempsky
Copy link
Member

commented Jul 14, 2015

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

This comment has been minimized.

Copy link
Contributor

commented Jul 14, 2015

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.