Module stdio

Source
Available on crate feature stdio only.
Expand description

Functions returning the stdio file descriptors.

§Safety

Some of the functions in this module can cause the process’ stdio file descriptors to be closed, which breaks the assumption made in Rust’s std that these file descriptors are always open.

And in no-std mode, some of the functions in this module similarly assume that the process’ stdio file descriptors are open, which we don’t take as given in no-std mode because we don’t have std also making that assumption.

See the individual functions’ safety comments for more details.

Functions§

dup2_stderr
Utility function to safely dup2 over stderr (fd 2).
dup2_stdin
Utility function to safely dup2 over stdin (fd 0).
dup2_stdout
Utility function to safely dup2 over stdout (fd 1).
raw_stderr
STDERR_FILENO—Standard error, raw.
raw_stdin
STDIN_FILENO—Standard input, raw.
raw_stdout
STDOUT_FILENO—Standard output, raw.
stderr
STDERR_FILENO—Standard error, borrowed.
stdin
STDIN_FILENO—Standard input, borrowed.
stdout
STDOUT_FILENO—Standard output, borrowed.
take_stderr
STDERR_FILENO—Standard error, owned.
take_stdin
STDIN_FILENO—Standard input, owned.
take_stdout
STDOUT_FILENO—Standard output, owned.