Skip to content

Document interaction of std APIs with OS syscalls #27537

Closed
@alexcrichton

Description

@alexcrichton

@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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions