Skip to content

Document interaction of std APIs with OS syscalls #27537

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

Closed
alexcrichton opened this issue Aug 5, 2015 · 1 comment
Closed

Document interaction of std APIs with OS syscalls #27537

alexcrichton opened this issue Aug 5, 2015 · 1 comment

Comments

@alexcrichton
Copy link
Member

@aturon and I have long had the desire to audit all of our various std::{io, process, env, fs, os} APIs with what they're actually doing on all platforms. This is very helpful for getting more information about the precise semantics of the API in various corner cases as well as explaining what's going on under the hood.

This is a pretty big bug and probably shouldn't be tackled all at once, but what we've been thinking is something along the lines of:

  • All of these APIs will have a "Platform Behavior" section of the documentation.
  • Each API will document what syscall it invokes, as well as perhaps how the various arguments translate. For example OpenOptions::open is documented on unix as calling the open syscall followed by a ioctl to set the file descriptor to CLOEXEC. The documentation would also state that we may one day use newer versions of open which allow setting CLOEXEC atomically.
  • We want to be relatively relaxed in the documentation to allow ourselves room to tweak various aspects here and there in the future.

Ideally this is will happen exhaustively to all I/O APIs, but that's probably a long ways out. Either way seems like a good bug to track!

@alexcrichton
Copy link
Member Author

Er, dupe of #24795

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

No branches or pull requests

1 participant