pub struct RealSystem(/* private fields */);Expand description
Implementation of system traits that actually interact with the underlying system
RealSystem is an empty struct because the underlying operating system
manages the system’s internal state.
Some trait methods implemented by RealSystem (such as SendSignal::kill)
return futures, but the returned futures do not perform asynchronous operations.
Those methods block the current thread until the underlying system calls
complete and then return ready futures.
See also the system module documentation.
Implementations§
Source§impl RealSystem
impl RealSystem
Sourcepub unsafe fn new() -> Self
pub unsafe fn new() -> Self
Returns an instance of RealSystem.
§Safety
This function is marked unsafe because improper use of RealSystem
may lead to undefined behavior. Remember that most operations performed
on the system by Env are not thread-safe. You should never use
RealSystem in a multi-threaded program, and it is your responsibility
to make sure you are using only one instance of ReadSystem in the
process.
Trait Implementations§
Source§impl CaughtSignals for RealSystem
impl CaughtSignals for RealSystem
Source§impl Chdir for RealSystem
impl Chdir for RealSystem
Source§impl Close for RealSystem
impl Close for RealSystem
Source§impl Debug for RealSystem
impl Debug for RealSystem
Source§impl Dup for RealSystem
impl Dup for RealSystem
Source§impl Exec for RealSystem
impl Exec for RealSystem
Source§impl Exit for RealSystem
impl Exit for RealSystem
Source§fn exit(
&self,
exit_status: ExitStatus,
) -> impl Future<Output = Infallible> + use<>
fn exit( &self, exit_status: ExitStatus, ) -> impl Future<Output = Infallible> + use<>
Source§impl Fcntl for RealSystem
impl Fcntl for RealSystem
Source§fn ofd_access(&self, fd: Fd) -> Result<OfdAccess>
fn ofd_access(&self, fd: Fd) -> Result<OfdAccess>
Source§fn get_and_set_nonblocking(&self, fd: Fd, nonblocking: bool) -> Result<bool>
fn get_and_set_nonblocking(&self, fd: Fd, nonblocking: bool) -> Result<bool>
Source§impl Fork for RealSystem
impl Fork for RealSystem
Source§fn new_child_process(&self) -> Result<ChildProcessStarter<Self>>
fn new_child_process(&self) -> Result<ChildProcessStarter<Self>>
Creates a new child process.
This implementation calls the fork system call and returns both in the
parent and child process. In the parent, the returned
ChildProcessStarter ignores any arguments and returns the child
process ID. In the child, the starter runs the task and exits the
process.
Source§impl Fstat for RealSystem
impl Fstat for RealSystem
Source§fn fstatat(
&self,
dir_fd: Fd,
path: &CStr,
follow_symlinks: bool,
) -> Result<Stat>
fn fstatat( &self, dir_fd: Fd, path: &CStr, follow_symlinks: bool, ) -> Result<Stat>
Source§fn is_directory(&self, path: &CStr) -> bool
fn is_directory(&self, path: &CStr) -> bool
Source§fn fd_is_pipe(&self, fd: Fd) -> bool
fn fd_is_pipe(&self, fd: Fd) -> bool
Source§impl GetCwd for RealSystem
impl GetCwd for RealSystem
Source§impl GetPid for RealSystem
impl GetPid for RealSystem
Source§impl GetPw for RealSystem
impl GetPw for RealSystem
Source§impl GetRlimit for RealSystem
impl GetRlimit for RealSystem
Source§impl GetSigaction for RealSystem
impl GetSigaction for RealSystem
Source§fn get_sigaction(&self, signal: Number) -> Result<Disposition>
fn get_sigaction(&self, signal: Number) -> Result<Disposition>
Source§impl GetUid for RealSystem
impl GetUid for RealSystem
Source§impl IsExecutableFile for RealSystem
impl IsExecutableFile for RealSystem
Source§fn is_executable_file(&self, path: &CStr) -> bool
fn is_executable_file(&self, path: &CStr) -> bool
Source§impl Isatty for RealSystem
impl Isatty for RealSystem
Source§impl Open for RealSystem
impl Open for RealSystem
Source§fn open(
&self,
path: &CStr,
access: OfdAccess,
flags: EnumSet<OpenFlag>,
mode: Mode,
) -> Result<Fd>
fn open( &self, path: &CStr, access: OfdAccess, flags: EnumSet<OpenFlag>, mode: Mode, ) -> Result<Fd>
Source§fn open_tmpfile(&self, parent_dir: &Path) -> Result<Fd>
fn open_tmpfile(&self, parent_dir: &Path) -> Result<Fd>
Source§impl Pipe for RealSystem
impl Pipe for RealSystem
Source§impl Read for RealSystem
impl Read for RealSystem
Source§impl Seek for RealSystem
impl Seek for RealSystem
Source§impl Select for RealSystem
impl Select for RealSystem
Source§impl SendSignal for RealSystem
impl SendSignal for RealSystem
Source§impl SetPgid for RealSystem
impl SetPgid for RealSystem
Source§impl SetRlimit for RealSystem
impl SetRlimit for RealSystem
Source§impl ShellPath for RealSystem
impl ShellPath for RealSystem
Source§fn shell_path(&self) -> CString
fn shell_path(&self) -> CString
Returns the path to the shell.
On Linux, this function returns /proc/self/exe. On other platforms, it
searches for an executable sh from the default PATH returned by
confstr_path.
Source§impl Sigaction for RealSystem
impl Sigaction for RealSystem
Source§fn sigaction(
&self,
signal: Number,
handling: Disposition,
) -> Result<Disposition>
fn sigaction( &self, signal: Number, handling: Disposition, ) -> Result<Disposition>
Source§impl Sigmask for RealSystem
impl Sigmask for RealSystem
Source§impl Signals for RealSystem
impl Signals for RealSystem
Source§const SIGINFO: Option<Number> = None
const SIGINFO: Option<Number> = None
SIGINFO, if available on the systemSource§const SIGLOST: Option<Number> = None
const SIGLOST: Option<Number> = None
SIGLOST, if available on the systemSource§fn sigrt_range(&self) -> Option<RangeInclusive<Number>>
fn sigrt_range(&self) -> Option<RangeInclusive<Number>>
Source§const NAMED_SIGNALS: &'static [(&'static str, Option<Number>)] = _
const NAMED_SIGNALS: &'static [(&'static str, Option<Number>)] = _
Source§fn iter_sigrt(&self) -> impl DoubleEndedIterator<Item = Number> + use<Self>
fn iter_sigrt(&self) -> impl DoubleEndedIterator<Item = Number> + use<Self>
Source§fn to_signal_number<N: Into<RawNumber>>(&self, number: N) -> Option<Number>
fn to_signal_number<N: Into<RawNumber>>(&self, number: N) -> Option<Number>
Source§fn sig2str<N: Into<RawNumber>>(&self, signal: N) -> Option<Cow<'static, str>>
fn sig2str<N: Into<RawNumber>>(&self, signal: N) -> Option<Cow<'static, str>>
Source§fn str2sig(&self, name: &str) -> Option<Number>
fn str2sig(&self, name: &str) -> Option<Number>
Source§fn validate_signal(&self, number: RawNumber) -> Option<(Name, Number)>
fn validate_signal(&self, number: RawNumber) -> Option<(Name, Number)>
Source§impl Sysconf for RealSystem
impl Sysconf for RealSystem
Source§fn confstr_path(&self) -> Result<UnixString>
fn confstr_path(&self) -> Result<UnixString>
$PATH value where all standard utilities are
expected to be found. Read moreSource§impl TcGetPgrp for RealSystem
impl TcGetPgrp for RealSystem
Source§impl TcSetPgrp for RealSystem
impl TcSetPgrp for RealSystem
Source§impl Times for RealSystem
impl Times for RealSystem
Source§impl Umask for RealSystem
impl Umask for RealSystem
Source§impl Wait for RealSystem
impl Wait for RealSystem
Auto Trait Implementations§
impl Freeze for RealSystem
impl RefUnwindSafe for RealSystem
impl Send for RealSystem
impl Sync for RealSystem
impl Unpin for RealSystem
impl UnwindSafe for RealSystem
Blanket Implementations§
Source§impl<T> SystemEx for T
impl<T> SystemEx for T
Source§fn move_fd_internal(&mut self, from: Fd) -> Result<Fd>
fn move_fd_internal(&mut self, from: Fd) -> Result<Fd>
yash_env::io::move_fd_internal insteadMIN_INTERNAL_FD or larger. Read moreSource§fn fd_is_pipe(&self, fd: Fd) -> bool
fn fd_is_pipe(&self, fd: Fd) -> bool
yash_env::system::Fstat::fd_is_pipe insteadSource§fn tcsetpgrp_with_block(
&mut self,
fd: Fd,
pgid: Pid,
) -> impl Future<Output = Result<()>>
fn tcsetpgrp_with_block( &mut self, fd: Fd, pgid: Pid, ) -> impl Future<Output = Result<()>>
yash_env::job::tcsetpgrp_with_block insteadSource§fn tcsetpgrp_without_block(
&mut self,
fd: Fd,
pgid: Pid,
) -> impl Future<Output = Result<()>>
fn tcsetpgrp_without_block( &mut self, fd: Fd, pgid: Pid, ) -> impl Future<Output = Result<()>>
yash_env::job::tcsetpgrp_without_block insteadSource§fn signal_name_from_number(&self, number: Number) -> Name
fn signal_name_from_number(&self, number: Number) -> Name
yash_env::system::Signals::signal_name_from_number insteadSource§fn exit_or_raise(
&mut self,
exit_status: ExitStatus,
) -> impl Future<Output = Infallible>
fn exit_or_raise( &mut self, exit_status: ExitStatus, ) -> impl Future<Output = Infallible>
yash_env::semantics::exit_or_raise insteadSource§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more