mod concurrency;
mod errno;
mod file_system;
mod future;
mod io;
mod process;
#[cfg(unix)]
pub mod real;
pub mod resource;
mod select;
mod shared;
mod signal;
mod sysconf;
mod terminal;
mod time;
mod user;
pub mod r#virtual;
pub use self::concurrency::{Concurrent, SignalList};
pub use self::errno::Errno;
pub use self::errno::RawErrno;
pub use self::errno::Result;
pub use self::file_system::{
AT_FDCWD, Chdir, Dir, DirEntry, FileType, Fstat, GetCwd, IsExecutableFile, Mode, OfdAccess,
Open, OpenFlag, RawMode, Seek, Stat, Umask,
};
#[allow(deprecated)]
pub use self::future::FlexFuture;
pub use self::io::{Close, Dup, Fcntl, FdFlag, Pipe, Read, Write};
pub use self::process::{
ChildProcessStarter, ChildProcessTask, Exec, Exit, Fork, GetPid, SetPgid, Wait,
};
#[cfg(all(doc, unix))]
use self::real::RealSystem;
use self::resource::{GetRlimit, LimitPair, Resource, SetRlimit};
pub use self::select::Select;
use self::select::SelectSystem;
use self::select::SignalStatus;
#[allow(deprecated)]
pub use self::shared::SharedSystem;
pub use self::signal::{
CaughtSignals, Disposition, GetSigaction, SendSignal, Sigaction, Sigmask, SigmaskOp, Signals,
};
pub use self::sysconf::{ShellPath, Sysconf};
pub use self::terminal::{Isatty, TcGetPgrp, TcSetPgrp};
pub use self::time::{Clock, CpuTimes, Times};
pub use self::user::{GetPw, GetUid, Gid, RawGid, RawUid, Uid};
#[cfg(doc)]
use self::r#virtual::VirtualSystem;
use crate::io::Fd;
#[cfg(doc)]
use crate::io::MIN_INTERNAL_FD;
use crate::job::Pid;
use crate::path::Path;
use crate::path::PathBuf;
use crate::semantics::ExitStatus;
use crate::str::UnixString;
#[cfg(doc)]
use crate::subshell::Subshell;
use crate::trap::SignalSystem;
use std::convert::Infallible;
use std::fmt::Debug;
#[deprecated(
note = "use smaller, more specialized traits declared in the `system` module instead",
since = "0.11.0"
)]
pub trait System:
CaughtSignals
+ Chdir
+ Clock
+ Close
+ Debug
+ Dup
+ Exec
+ Exit
+ Fcntl
+ Fork
+ Fstat
+ GetCwd
+ GetPid
+ GetPw
+ GetRlimit
+ GetUid
+ IsExecutableFile
+ Isatty
+ Open
+ Pipe
+ Read
+ Seek
+ Select
+ SendSignal
+ SetPgid
+ SetRlimit
+ ShellPath
+ Sigaction
+ Sigmask
+ Signals
+ Sysconf
+ TcGetPgrp
+ TcSetPgrp
+ Times
+ Umask
+ Wait
+ Write
{
}
#[allow(deprecated)]
impl<T> System for T where
T: CaughtSignals
+ Chdir
+ Clock
+ Close
+ Debug
+ Dup
+ Exec
+ Exit
+ Fcntl
+ Fork
+ Fstat
+ GetCwd
+ GetPid
+ GetPw
+ GetRlimit
+ GetUid
+ IsExecutableFile
+ Isatty
+ Open
+ Pipe
+ Read
+ Seek
+ Select
+ SendSignal
+ SetPgid
+ SetRlimit
+ ShellPath
+ Sigaction
+ Sigmask
+ Signals
+ Sysconf
+ TcGetPgrp
+ TcSetPgrp
+ Times
+ Umask
+ Wait
+ Write
{
}
#[allow(deprecated)]
#[deprecated(
note = "use functions in the `yash-env::io` and `yash-env::job` modules instead",
since = "0.11.0"
)]
pub trait SystemEx: System {
#[deprecated(
note = "use `yash_env::io::move_fd_internal` instead",
since = "0.11.0"
)]
fn move_fd_internal(&mut self, from: Fd) -> Result<Fd> {
crate::io::move_fd_internal(self, from)
}
#[deprecated(
note = "use `yash_env::system::Fstat::fd_is_pipe` instead",
since = "0.11.0"
)]
fn fd_is_pipe(&self, fd: Fd) -> bool {
crate::system::Fstat::fd_is_pipe(self, fd)
}
#[deprecated(
note = "use `yash_env::job::tcsetpgrp_with_block` instead",
since = "0.11.0"
)]
fn tcsetpgrp_with_block(&mut self, fd: Fd, pgid: Pid) -> impl Future<Output = Result<()>> {
crate::job::tcsetpgrp_with_block(self, fd, pgid)
}
#[deprecated(
note = "use `yash_env::job::tcsetpgrp_without_block` instead",
since = "0.11.0"
)]
fn tcsetpgrp_without_block(&mut self, fd: Fd, pgid: Pid) -> impl Future<Output = Result<()>> {
crate::job::tcsetpgrp_without_block(self, fd, pgid)
}
#[deprecated(
note = "use `yash_env::system::Signals::signal_name_from_number` instead",
since = "0.11.0"
)]
#[must_use]
fn signal_name_from_number(&self, number: signal::Number) -> signal::Name {
self.validate_signal(number.as_raw()).unwrap().0
}
#[deprecated(
note = "use `yash_env::semantics::exit_or_raise` instead",
since = "0.11.0"
)]
fn exit_or_raise(&mut self, exit_status: ExitStatus) -> impl Future<Output = Infallible> {
async move { crate::semantics::exit_or_raise(self, exit_status).await }
}
}
#[allow(deprecated)]
impl<T: System + ?Sized> SystemEx for T {}