Home

RLIMITFSIZE

RLIMIT_FSIZE is a per-process resource limit that controls the maximum size to which a file can be created or grown by that process. The limit is expressed in bytes and is stored as a pair in struct rlimit: a soft limit (rlim_cur) and a hard limit (rlim_max).

The limit applies to operations that increase a file’s size, such as write and ftruncate. If a

Interfaces and data structures: The limits are retrieved and changed with getrlimit and setrlimit using the

Usage and behavior: The soft limit (rlim_cur) can be increased by the process up to the hard

Inheritance and environment: Limits are inherited by child processes after fork and persist across execve calls.

See also: RLIMIT_AS, RLIMIT_CPU, getrlimit, setrlimit.

write
would
enlarge
a
file
beyond
rlim_cur,
the
kernel
prevents
the
operation
and
returns
an
error,
typically
errno
EFBIG
(File
too
large).
resource
RLIMIT_FSIZE.
The
struct
rlimit
contains
rlim_cur
and
rlim_max,
both
of
type
rlim_t.
A
value
of
RLIM_INFINITY
means
no
limit.
limit
(rlim_max)
using
setrlimit.
Raising
beyond
the
hard
limit
generally
requires
appropriate
privileges,
such
as
root
access.
The
hard
limit
represents
the
ceiling
that
cannot
be
exceeded
without
special
permissions.
The
soft
limit
can
also
be
lowered.
In
modern
environments
such
as
containers,
RLIMIT_FSIZE
may
be
further
constrained
by
cgroups
or
security
policies,
which
can
override
or
supplement
per-process
limits.