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

Remove return value from pause #827

Closed
Thomasdezeeuw opened this issue Jan 6, 2018 · 2 comments
Closed

Remove return value from pause #827

Thomasdezeeuw opened this issue Jan 6, 2018 · 2 comments

Comments

@Thomasdezeeuw
Copy link
Contributor

Currently nix::unistd::pause returns an nix::Error, however it can only return EINTR as an error, which is the point of pause. It pauses until a signal is received. So I suggest to remove the return value completely and document that pause only returns if the process receives a signal.

If you want to be really safe maybe an assert can be added to check if the error is really EINTR, but then the OS/libc is vialting the spec.

Man page: http://pubs.opengroup.org/onlinepubs/9699919799/functions/pause.html.

@Susurrus
Copy link
Contributor

Susurrus commented Jan 7, 2018

Yes, that seems like a nice ergonomics improvement! Care to submit a PR for it?

@Thomasdezeeuw
Copy link
Contributor Author

Closed by #836.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants