Module stdio

Available on crate feature dep_rustix only.
Expand description

Functions returning the stdio file descriptors.

§Safety

These access the file descriptors by absolute index value, and nothing prevents them from being closed and reused. They should only be used in main or other situations where one is in control of the process’ stdio streams.

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.