shell::platform

Enum RLimit

Source
pub enum RLimit {
Show 20 variants SocketBufferSize, CoreSize, DataSize, Nice, FileSize, SigPending, KQueues, MemLock, RSS, MaxFiles, MessageQueueByte, RealTimePriority, StackSize, CpuTime, MaxProcs, MaxMemory, MaxFileLocks, MaxPtty, MaxRealTime, MaxThreads,
}
Expand description

Abstraction over the various rlimits.

Variants§

§

SocketBufferSize

-b: The maximum socket buffer size. RLIMIT_SBSIZE (freebsd, dragonfly)

§

CoreSize

-c; The maximum size of core files created. RLIMIT_CORE The maximum size core file that this process can create. If the process terminates and would dump a core file larger than this, then no core file is created. So setting this limit to zero prevents core files from ever being created.

§

DataSize

-d: The maximum size of a process’s data segment. RLIMIT_DATA The maximum size of data memory for the process. If the process tries to allocate data memory beyond this amount, the allocation function fails.

§

Nice

-e: The maximum scheduling priority (“nice”). RLIMIT_NICE Specifies a ceiling to which the process’s nice value can be raised using setpriority(2) or nice(2). The actual ceiling for the nice value is calculated as 20 - rlim_cur. (This strangeness occurs because negative numbers cannot be specified as resource limit values, since they typically have special meanings. For example, RLIM_INFINITY typically is the same as -1.)

§

FileSize

-f: The maximum size of files written by the shell and its children. RLIMIT_FSIZE The maximum size of file the process can create. Trying to write a larger file causes a signal: SIGXFSZ.

§

SigPending

-i: The maximum number of pending signals.RLIMIT_SIGPENDING Specifies the limit on the number of signals that may be queued for the real user ID of the calling process. Both standard and real-time signals are counted for the purpose of checking this limit. However, the limit is only enforced for sigqueue(3); it is always possible to use kill(2) to queue one instance of any of the signals that are not already queued to the process.

§

KQueues

-k: The maximum number of kqueues that may be allocated. RLIMIT_KQUEUES (freebsd)

§

MemLock

-l: The maximum size that may be locked into memory. RLIMIT_MEMLOCK, The maximum size (in bytes) which a process may lock into memory using the mlock(2) system call.

§

RSS

-m: The maximum resident set size (many systems do not honor this limit). RLIMIT_RSS When there is memory pressure and swap is available, prioritize eviction of a process’ resident pages beyond this amount (in bytes).

§

MaxFiles

-n: The maximum number of open file descriptors (most systems do not allow this value to be set). RLIMIT_NOFILE

§

MessageQueueByte

-q: The maximum number of bytes in POSIX message queues. RLIMIT_MSGQUEUE A limit on the number of bytes that can be allocated for POSIX message queues for the real user ID of the calling process.

§

RealTimePriority

-r: The maximum real-time scheduling priority. RLIMIT_RTPRIO

§

StackSize

-s: The maximum stack size. RLIMIT_STACK

§

CpuTime

-t: The maximum amount of cpu time in seconds. RLIMIT_CPU

§

MaxProcs

-u: The maximum number of processes available to a single user. RLIMIT_NPROC

§

MaxMemory

-v: The maximum amount of virtual memory available to the shell, and, on some systems, to its children. RLIMIT_AS

§

MaxFileLocks

-x: The maximum number of file locks. RLIMIT_LOCKS

§

MaxPtty

-P: The maximum number of pseudoterminals. RLIMIT_NPTS

§

MaxRealTime

-R: The maximum time a real-time process can run before blocking, in microseconds. RLIMIT_RTTIME

§

MaxThreads

-T: The maximum number of threads. RLIMIT_NPROC (Same as MaxProcs- Linux)

Auto Trait Implementations§

§

impl Freeze for RLimit

§

impl RefUnwindSafe for RLimit

§

impl Send for RLimit

§

impl Sync for RLimit

§

impl Unpin for RLimit

§

impl UnwindSafe for RLimit

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.