-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Audit and document the system calls made for each "primitive" IO API #24795
Comments
I believe that #27537 has just superseded this ticket. @alexcrichton ? |
Oops, that's actually a duplicate of this, I tried to find this and wasn't able to find it! |
I'd love to start contributing some docs and this seems like a decent place to Platform NotesWindows
Defined in
Defined asBOOL DeleteFileW(LPCWSTR lpFileName); Unix
Defined in
Defined asint unlink(const char *pathname); Which could go into the comments above that function in I see this being important for the following reason, TcpStream::read on |
@nathansizemore you're certainly more than welcome to jump in and help! That looks pretty good to me, but you probably don't need to go into quite so much detail about things like the C signature or the header file the functions come from. I think it's fine to basically say the behavior on Windows is to call the Documenting trait implementations may be a little trickier, yeah, but adding the docs to the impl itself should work out just fine at least in terms of the source code, and we can be sure to surface them in rustdoc at some point in the future if necessary. For now though it's probably fine to punt on those temporarily as most of the meat of our I/O bindings aren't in trait implementations. |
A part of #29359 |
Triage: no change |
Tagging as p-medium; this probably will evolve into a checklist issue, given how big it is. |
Triage; no change. This is a big job, and I think it would be useful, but there also doesn't seem to be a ton of demand. I also wonder if it doesn't tie us too much to specifics; we can say that these are purely informative, not normative, but still... then again, I also am not sure how much of these details would change at this point, really.... |
@steveklabnik Personally I think we should probably cease to try and document the exact system calls made by each of these functions? I see the following pro's and con's: Pro's:
Con's:
If people are really that much into performance, some special purpose high performance IO library might be more suited, or they could just take a look into the implementation of each File. I do however think that we should mention best practices (for performance and safety reasons) when working with IO related types. |
I agree with your assessment, basically. This issue was opened a long time ago, but it doesn't seem like there's been that much demand for this. Maybe @rust-lang/libs can chime in if this is something that they still want, and is worth spending our time on? |
I agree that there's not a ton of value here. |
Agreed with @sfackler, so I'm going to close this. |
Now that IO reform is complete, we have a large number of "primitive" IO APIs -- functions in Rust that roughly correspond to a single system API, like opening a file or extracting its metadata.
We need to go through all of these APIs and add a section like
# Platform notes
which details which system API(s) are being used for each platform (usually, a Unix/Windows division suffices).This documentation is very important for understanding the interaction of the
std
IO APIs with the underlying system, which is relevant when using lowering APIs, when sandboxing and application, and likely for other scenarios as well.The text was updated successfully, but these errors were encountered: