Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upAudit and document the system calls made for each "primitive" IO API #24795
Comments
aturon
added
A-docs
labels
Apr 24, 2015
This comment has been minimized.
This comment has been minimized.
|
I believe that #27537 has just superseded this ticket. @alexcrichton ? |
This comment has been minimized.
This comment has been minimized.
|
Oops, that's actually a duplicate of this, I tried to find this and wasn't able to find it! |
alexcrichton
referenced this issue
Aug 5, 2015
Closed
Document interaction of std APIs with OS syscalls #27537
This comment has been minimized.
This comment has been minimized.
|
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 |
This comment has been minimized.
This comment has been minimized.
|
@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. |
nathansizemore
referenced this issue
Sep 24, 2015
Closed
Added platform notes to fs pub functions #28613
This comment has been minimized.
This comment has been minimized.
|
A part of #29359 |
This comment has been minimized.
This comment has been minimized.
|
Triage: no change |
steveklabnik
added
the
T-doc
label
Mar 10, 2017
steveklabnik
removed
the
A-docs
label
Mar 24, 2017
steveklabnik
added
the
P-medium
label
May 24, 2017
This comment has been minimized.
This comment has been minimized.
|
Tagging as p-medium; this probably will evolve into a checklist issue, given how big it is. |
Mark-Simulacrum
removed
the
A-io
label
Jun 25, 2017
Mark-Simulacrum
added
the
C-bug
label
Jul 22, 2017
steveklabnik
added
the
E-hard
label
May 28, 2018
This comment has been minimized.
This comment has been minimized.
|
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.... |
This was referenced Jan 10, 2019
This comment has been minimized.
This comment has been minimized.
|
@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. |
This comment has been minimized.
This comment has been minimized.
|
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? |
This comment has been minimized.
This comment has been minimized.
|
I agree that there's not a ton of value here. |
This comment has been minimized.
This comment has been minimized.
|
Agreed with @sfackler, so I'm going to close this. |
aturon commentedApr 24, 2015
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 noteswhich 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
stdIO APIs with the underlying system, which is relevant when using lowering APIs, when sandboxing and application, and likely for other scenarios as well.