1997-01-21 15:05:15 +00:00
|
|
|
.\" Copyright (c) 1996 David Nugent <davidn@blaze.net.au>
|
|
|
|
.\" All rights reserved.
|
|
|
|
.\"
|
|
|
|
.\" Redistribution and use in source and binary forms, with or without
|
|
|
|
.\" modification, is permitted provided that the following conditions
|
|
|
|
.\" are met:
|
|
|
|
.\" 1. Redistributions of source code must retain the above copyright
|
|
|
|
.\" notice immediately at the beginning of the file, without modification,
|
|
|
|
.\" this list of conditions, and the following disclaimer.
|
|
|
|
.\" 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer in the
|
|
|
|
.\" documentation and/or other materials provided with the distribution.
|
|
|
|
.\" 3. This work was done expressly for inclusion into FreeBSD. Other use
|
|
|
|
.\" is permitted provided this notation is included.
|
|
|
|
.\" 4. Absolutely no warranty of function or purpose is made by the author
|
|
|
|
.\" David Nugent.
|
|
|
|
.\" 5. Modifications may be freely made to this file providing the above
|
|
|
|
.\" conditions are met.
|
|
|
|
.\"
|
1999-08-28 01:08:13 +00:00
|
|
|
.\" $FreeBSD$
|
1997-01-21 15:05:15 +00:00
|
|
|
.\"
|
2020-06-25 16:46:27 +00:00
|
|
|
.Dd June 25, 2020
|
1997-01-21 15:05:15 +00:00
|
|
|
.Dt LIMITS 1
|
2001-07-10 14:16:33 +00:00
|
|
|
.Os
|
1997-01-21 15:05:15 +00:00
|
|
|
.Sh NAME
|
|
|
|
.Nm limits
|
1997-07-21 12:06:18 +00:00
|
|
|
.Nd set or display process resource limits
|
1997-01-21 15:05:15 +00:00
|
|
|
.Sh SYNOPSIS
|
2000-11-20 19:21:22 +00:00
|
|
|
.Nm
|
2012-01-25 20:14:41 +00:00
|
|
|
.Op Fl C Ar class | Fl P Ar pid | Fl U Ar user
|
1997-01-21 15:05:15 +00:00
|
|
|
.Op Fl SHB
|
1997-07-21 12:06:18 +00:00
|
|
|
.Op Fl ea
|
2016-03-12 14:54:34 +00:00
|
|
|
.Op Fl bcdfklmnopstuvw Op Ar val
|
2000-11-20 19:21:22 +00:00
|
|
|
.Nm
|
2002-11-26 14:00:39 +00:00
|
|
|
.Op Fl C Ar class | Fl U Ar user
|
1997-07-21 12:06:18 +00:00
|
|
|
.Op Fl SHB
|
2016-03-12 14:54:34 +00:00
|
|
|
.Op Fl bcdfklmnopstuvw Op Ar val
|
1997-07-21 12:06:18 +00:00
|
|
|
.Op Fl E
|
2002-11-26 14:00:39 +00:00
|
|
|
.Oo
|
2001-02-01 16:38:02 +00:00
|
|
|
.Op Ar name Ns = Ns Ar value ...
|
2002-11-26 14:00:39 +00:00
|
|
|
.Ar command
|
|
|
|
.Oc
|
1997-01-21 15:05:15 +00:00
|
|
|
.Sh DESCRIPTION
|
2002-04-20 12:18:28 +00:00
|
|
|
The
|
|
|
|
.Nm
|
|
|
|
utility either prints or sets kernel resource limits, and may optionally set
|
1997-01-21 15:05:15 +00:00
|
|
|
environment variables like
|
|
|
|
.Xr env 1
|
|
|
|
and run a program with the selected resources.
|
|
|
|
Three uses of the
|
2000-03-26 14:37:47 +00:00
|
|
|
.Nm
|
2002-11-26 14:00:39 +00:00
|
|
|
utility are possible:
|
2001-02-14 10:14:35 +00:00
|
|
|
.Bl -tag -width indent
|
|
|
|
.It Xo
|
|
|
|
.Nm
|
2000-11-20 19:21:22 +00:00
|
|
|
.Op Ar limitflags
|
2002-11-26 14:00:39 +00:00
|
|
|
.Op Ar name Ns = Ns Ar value ...
|
1997-01-21 15:05:15 +00:00
|
|
|
.Ar command
|
2001-02-14 10:14:35 +00:00
|
|
|
.Xc
|
1997-01-21 15:05:15 +00:00
|
|
|
This usage sets limits according to
|
|
|
|
.Ar limitflags ,
|
|
|
|
optionally sets environment variables given as
|
2001-02-01 16:38:02 +00:00
|
|
|
.Ar name Ns = Ns Ar value
|
2002-11-26 14:00:39 +00:00
|
|
|
pairs, and then runs the specified
|
|
|
|
.Ar command .
|
|
|
|
.It Nm Op Ar limitflags
|
1997-01-21 15:05:15 +00:00
|
|
|
This usage determines values of resource settings according to
|
|
|
|
.Ar limitflags ,
|
|
|
|
does not attempt to set them and outputs these values to
|
|
|
|
standard output.
|
|
|
|
By default, this will output the current kernel resource settings
|
|
|
|
active for the calling process.
|
|
|
|
Using the
|
|
|
|
.Fl C Ar class
|
|
|
|
or
|
|
|
|
.Fl U Ar user
|
2002-11-26 14:00:39 +00:00
|
|
|
options, you may also display the current resource settings modified
|
2001-06-24 01:34:38 +00:00
|
|
|
by the appropriate login class resource limit entries from
|
1997-01-21 15:05:15 +00:00
|
|
|
the
|
|
|
|
.Xr login.conf 5
|
|
|
|
login capabilities database.
|
2002-11-26 14:00:39 +00:00
|
|
|
.It Nm Fl e Op Ar limitflags
|
1997-01-21 15:05:15 +00:00
|
|
|
This usage determines values of resource settings according to
|
|
|
|
.Ar limitflags ,
|
2018-01-13 21:36:39 +00:00
|
|
|
but does not set them.
|
2002-11-26 14:00:39 +00:00
|
|
|
Like the previous usage, it outputs these values to standard
|
1997-01-21 15:05:15 +00:00
|
|
|
output, except that it will emit them in
|
2002-11-26 14:00:39 +00:00
|
|
|
.Ic eval
|
1997-01-21 15:05:15 +00:00
|
|
|
format, suitable for the calling shell.
|
2004-07-02 22:22:35 +00:00
|
|
|
If the shell is known (i.e., it is one of
|
2002-11-26 14:00:39 +00:00
|
|
|
.Nm sh , csh , bash , tcsh , ksh , pdksh
|
|
|
|
or
|
|
|
|
.Nm rc ) ,
|
2000-03-26 14:37:47 +00:00
|
|
|
.Nm
|
2002-11-26 14:00:39 +00:00
|
|
|
emits
|
|
|
|
.Ic limit
|
|
|
|
or
|
|
|
|
.Ic ulimit
|
|
|
|
commands in the format understood by
|
1997-01-21 15:05:15 +00:00
|
|
|
that shell.
|
2002-11-26 14:00:39 +00:00
|
|
|
If the name of the shell cannot be determined, then the
|
|
|
|
.Ic ulimit
|
1997-01-21 15:05:15 +00:00
|
|
|
format used by
|
2001-02-01 16:38:02 +00:00
|
|
|
.Xr sh 1
|
1997-01-21 15:05:15 +00:00
|
|
|
is used.
|
|
|
|
.Pp
|
|
|
|
This is very useful for setting limits used by scripts, or prior
|
|
|
|
launching of daemons and other background tasks with specific
|
|
|
|
resource limit settings, and provides the benefit of allowing
|
|
|
|
global configuration of maximum resource usage by maintaining a
|
|
|
|
central database of settings in the login class database.
|
|
|
|
.Pp
|
|
|
|
Within a shell script,
|
2000-03-26 14:37:47 +00:00
|
|
|
.Nm
|
1997-01-21 15:05:15 +00:00
|
|
|
will normally be used with eval within backticks as follows:
|
|
|
|
.Pp
|
2002-11-26 14:00:39 +00:00
|
|
|
.Dl "eval `limits -e -C daemon`"
|
1997-01-21 15:05:15 +00:00
|
|
|
.Pp
|
|
|
|
which causes the output of
|
2000-03-26 14:37:47 +00:00
|
|
|
.Nm
|
1997-01-21 15:05:15 +00:00
|
|
|
to be evaluated and set by the current shell.
|
|
|
|
.El
|
|
|
|
.Pp
|
2002-06-26 01:40:15 +00:00
|
|
|
The value of
|
|
|
|
.Ar limitflags
|
|
|
|
specified in the above contains one or more of the following options:
|
2002-11-26 14:00:39 +00:00
|
|
|
.Bl -tag -width ".Fl C Ar class"
|
1997-01-21 15:05:15 +00:00
|
|
|
.It Fl C Ar class
|
|
|
|
Use current resource values, modified by the resource entries applicable
|
2002-11-26 14:00:39 +00:00
|
|
|
for the login class
|
|
|
|
.Ar class .
|
1997-01-21 15:05:15 +00:00
|
|
|
.It Fl U Ar user
|
|
|
|
Use current resource values, modified by the resource entries applicable
|
2002-11-26 14:00:39 +00:00
|
|
|
to the login class the
|
|
|
|
.Ar user
|
|
|
|
belongs to.
|
|
|
|
If user does not belong to any class, then the resource capabilities
|
|
|
|
for the
|
|
|
|
.Dq Li default
|
|
|
|
class are used, if it exists, or the
|
|
|
|
.Dq Li root
|
|
|
|
class if the user is a superuser account.
|
2012-01-25 20:14:41 +00:00
|
|
|
.It Fl P Ar pid
|
|
|
|
Select or set limits for the process identified by the
|
|
|
|
.Ar pid .
|
1997-01-21 15:05:15 +00:00
|
|
|
.It Fl S
|
2002-11-26 14:00:39 +00:00
|
|
|
Select display or setting of
|
|
|
|
.Dq soft
|
|
|
|
(or current) resource limits.
|
1997-01-21 15:05:15 +00:00
|
|
|
If specific limits settings follow this switch, only soft limits are
|
|
|
|
affected unless overridden later with either the
|
|
|
|
.Fl H
|
|
|
|
or
|
|
|
|
.Fl B
|
2002-11-26 14:00:39 +00:00
|
|
|
options.
|
1997-01-21 15:05:15 +00:00
|
|
|
.It Fl H
|
2002-11-26 14:00:39 +00:00
|
|
|
Select display or setting of
|
|
|
|
.Dq hard
|
|
|
|
(or maximum) resource limits.
|
1997-01-21 15:05:15 +00:00
|
|
|
If specific limits settings follow this switch, only hard limits are
|
|
|
|
affected until overridden later with either the
|
|
|
|
.Fl S
|
|
|
|
or
|
|
|
|
.Fl B
|
2002-11-26 14:00:39 +00:00
|
|
|
options.
|
1997-01-21 15:05:15 +00:00
|
|
|
.It Fl B
|
2002-11-26 14:00:39 +00:00
|
|
|
Select display or setting of both
|
|
|
|
.Dq soft
|
|
|
|
(current) or
|
|
|
|
.Dq hard
|
|
|
|
(maximum)
|
1997-01-21 15:05:15 +00:00
|
|
|
resource limits.
|
|
|
|
If specific limits settings follow this switch, both soft and hard
|
|
|
|
limits are affected until overridden later with either the
|
|
|
|
.Fl S
|
2001-07-15 08:06:20 +00:00
|
|
|
or
|
1997-01-21 15:05:15 +00:00
|
|
|
.Fl H
|
2002-11-26 14:00:39 +00:00
|
|
|
options.
|
2012-05-10 02:07:00 +00:00
|
|
|
.It Fl e
|
2002-11-26 14:00:39 +00:00
|
|
|
Select
|
|
|
|
.Dq "eval mode"
|
|
|
|
formatting for output.
|
2018-01-13 21:36:39 +00:00
|
|
|
This is valid only in display mode and cannot be used when running a
|
1997-01-21 15:05:15 +00:00
|
|
|
command.
|
1998-06-04 21:06:07 +00:00
|
|
|
The exact syntax used for output depends upon the type of shell from
|
1997-01-21 15:05:15 +00:00
|
|
|
which
|
2000-03-26 14:37:47 +00:00
|
|
|
.Nm
|
1997-01-21 15:05:15 +00:00
|
|
|
is invoked.
|
2002-11-26 14:00:39 +00:00
|
|
|
.It Fl b Op Ar val
|
|
|
|
Select or set the
|
|
|
|
.Va sbsize
|
1999-10-09 20:47:59 +00:00
|
|
|
resource limit.
|
2002-11-26 14:00:39 +00:00
|
|
|
.It Fl c Op Ar val
|
|
|
|
Select or set (if
|
|
|
|
.Ar val
|
|
|
|
is specified) the
|
|
|
|
.Va coredumpsize
|
1997-01-21 15:05:15 +00:00
|
|
|
resource limit.
|
|
|
|
A value of 0 disables core dumps.
|
2002-11-26 14:00:39 +00:00
|
|
|
.It Fl d Op Ar val
|
|
|
|
Select or set (if
|
|
|
|
.Ar val
|
|
|
|
is specified) the
|
|
|
|
.Va datasize
|
1997-01-21 15:05:15 +00:00
|
|
|
resource limit.
|
2002-11-26 14:00:39 +00:00
|
|
|
.It Fl f Op Ar val
|
2000-03-26 14:37:47 +00:00
|
|
|
Select or set the
|
2002-11-26 14:00:39 +00:00
|
|
|
.Va filesize
|
1997-01-21 15:05:15 +00:00
|
|
|
resource limit.
|
2013-11-01 13:57:30 +00:00
|
|
|
.It Fl k Op Ar val
|
|
|
|
Select or set the
|
|
|
|
.Va kqueues
|
|
|
|
resource limit.
|
2002-11-26 14:00:39 +00:00
|
|
|
.It Fl l Op Ar val
|
2000-03-26 14:37:47 +00:00
|
|
|
Select or set the
|
2002-11-26 14:00:39 +00:00
|
|
|
.Va memorylocked
|
1997-01-21 15:05:15 +00:00
|
|
|
resource limit.
|
2002-11-26 14:00:39 +00:00
|
|
|
.It Fl m Op Ar val
|
2000-03-26 14:37:47 +00:00
|
|
|
Select or set the
|
2002-11-26 14:00:39 +00:00
|
|
|
.Va memoryuse
|
1997-07-21 12:06:18 +00:00
|
|
|
size limit.
|
2002-11-26 14:00:39 +00:00
|
|
|
.It Fl n Op Ar val
|
2000-03-26 14:37:47 +00:00
|
|
|
Select or set the
|
2002-11-26 14:00:39 +00:00
|
|
|
.Va openfiles
|
|
|
|
resource limit.
|
|
|
|
The system-wide limit on the maximum number of
|
|
|
|
open files per process can be viewed by examining the
|
|
|
|
.Va kern.maxfilesperproc
|
|
|
|
.Xr sysctl 8
|
|
|
|
variable.
|
|
|
|
The total number of simultaneously open files in the entire
|
|
|
|
system is limited to the value displayed by the
|
|
|
|
.Va kern.maxfiles
|
|
|
|
.Xr sysctl 8
|
|
|
|
variable.
|
2016-03-12 14:54:34 +00:00
|
|
|
.It Fl o Op Ar val
|
|
|
|
Select or set the
|
|
|
|
.Va umtxp
|
|
|
|
resource limit.
|
|
|
|
The limit determines the maximal number of the process-shared locks
|
|
|
|
which may be simultaneously created by the processes owned by the
|
|
|
|
user, see
|
|
|
|
.Xr pthread 3 .
|
|
|
|
.It Fl p Op Ar val
|
|
|
|
Select or set the
|
|
|
|
.Va pseudoterminals
|
|
|
|
resource limit.
|
2002-11-26 14:00:39 +00:00
|
|
|
.It Fl s Op Ar val
|
2000-03-26 14:37:47 +00:00
|
|
|
Select or set the
|
2002-11-26 14:00:39 +00:00
|
|
|
.Va stacksize
|
1997-01-21 15:05:15 +00:00
|
|
|
resource limit.
|
2002-11-26 14:00:39 +00:00
|
|
|
.It Fl t Op Ar val
|
2000-03-26 14:37:47 +00:00
|
|
|
Select or set the
|
2002-11-26 14:00:39 +00:00
|
|
|
.Va cputime
|
1997-01-21 15:05:15 +00:00
|
|
|
resource limit.
|
2002-11-26 14:00:39 +00:00
|
|
|
.It Fl u Op Ar val
|
2000-03-26 14:37:47 +00:00
|
|
|
Select or set the
|
2002-11-26 14:00:39 +00:00
|
|
|
.Va maxproc
|
|
|
|
resource limit.
|
|
|
|
The system-wide limit on the maximum number of processes
|
|
|
|
allowed per UID can be viewed by examining the
|
|
|
|
.Va kern.maxprocperuid
|
|
|
|
.Xr sysctl 8
|
|
|
|
variable.
|
1999-03-15 15:36:56 +00:00
|
|
|
The maximum number of processes that can be running simultaneously
|
2002-11-26 14:00:39 +00:00
|
|
|
in the entire system is limited to the value of the
|
|
|
|
.Va kern.maxproc
|
|
|
|
.Xr sysctl 8
|
|
|
|
variable.
|
|
|
|
.It Fl v Op Ar val
|
2002-06-26 03:43:25 +00:00
|
|
|
Select or set the
|
2002-11-26 14:00:39 +00:00
|
|
|
.Va virtualmem
|
2002-06-26 03:43:25 +00:00
|
|
|
resource limit.
|
|
|
|
This limit encompasses the entire VM space for the user process
|
|
|
|
and is inclusive of text, data, bss, stack,
|
|
|
|
.Xr brk 2 ,
|
|
|
|
.Xr sbrk 2
|
|
|
|
and
|
|
|
|
.Xr mmap 2 Ns 'd
|
|
|
|
space.
|
2011-04-05 07:56:40 +00:00
|
|
|
.It Fl w Op Ar val
|
|
|
|
Select or set the
|
|
|
|
.Va swapuse
|
|
|
|
resource limit.
|
2002-06-26 01:40:15 +00:00
|
|
|
.El
|
1997-01-21 15:05:15 +00:00
|
|
|
.Pp
|
2000-03-26 14:37:47 +00:00
|
|
|
Valid values for
|
2002-11-26 14:00:39 +00:00
|
|
|
.Ar val
|
|
|
|
in the above set of options consist of either the
|
2000-03-26 14:37:47 +00:00
|
|
|
string
|
2002-11-26 14:00:39 +00:00
|
|
|
.Dq Li infinity ,
|
|
|
|
.Dq Li inf ,
|
|
|
|
.Dq Li unlimited
|
2000-03-26 14:37:47 +00:00
|
|
|
or
|
2002-11-26 14:00:39 +00:00
|
|
|
.Dq Li unlimit
|
2000-03-26 14:37:47 +00:00
|
|
|
for an infinite (or kernel-defined maximum)
|
2002-11-26 14:00:39 +00:00
|
|
|
limit, or a numeric value optionally followed by a suffix.
|
1997-01-21 15:05:15 +00:00
|
|
|
Values which relate to size default to a value in bytes, or one of the
|
|
|
|
following suffixes may be used as a multiplier:
|
|
|
|
.Pp
|
2002-11-26 14:00:39 +00:00
|
|
|
.Bl -tag -offset indent -width 4n -compact
|
|
|
|
.It Li b
|
1997-01-21 15:05:15 +00:00
|
|
|
512 byte blocks.
|
2002-11-26 14:00:39 +00:00
|
|
|
.It Li k
|
1997-01-21 15:05:15 +00:00
|
|
|
kilobytes (1024 bytes).
|
2002-11-26 14:00:39 +00:00
|
|
|
.It Li m
|
1997-01-21 15:05:15 +00:00
|
|
|
megabytes (1024*1024 bytes).
|
2002-11-26 14:00:39 +00:00
|
|
|
.It Li g
|
1997-01-21 15:05:15 +00:00
|
|
|
gigabytes.
|
2002-11-26 14:00:39 +00:00
|
|
|
.It Li t
|
1998-06-04 21:06:07 +00:00
|
|
|
terabytes.
|
1997-01-21 15:05:15 +00:00
|
|
|
.El
|
|
|
|
.Pp
|
|
|
|
The
|
2002-11-26 14:00:39 +00:00
|
|
|
.Va cputime
|
1997-01-21 15:05:15 +00:00
|
|
|
resource defaults to a number of seconds, but a multiplier may be
|
|
|
|
used, and as with size values, multiple values separated by a valid
|
|
|
|
suffix are added together:
|
2002-11-26 14:00:39 +00:00
|
|
|
.Pp
|
|
|
|
.Bl -tag -offset indent -width 4n -compact
|
|
|
|
.It Li s
|
1997-01-21 15:05:15 +00:00
|
|
|
seconds.
|
2002-11-26 14:00:39 +00:00
|
|
|
.It Li m
|
1997-01-21 15:05:15 +00:00
|
|
|
minutes.
|
2002-11-26 14:00:39 +00:00
|
|
|
.It Li h
|
1997-01-21 15:05:15 +00:00
|
|
|
hours.
|
2002-11-26 14:00:39 +00:00
|
|
|
.It Li d
|
1997-01-21 15:05:15 +00:00
|
|
|
days.
|
2002-11-26 14:00:39 +00:00
|
|
|
.It Li w
|
1997-01-21 15:05:15 +00:00
|
|
|
weeks.
|
2002-11-26 14:00:39 +00:00
|
|
|
.It Li y
|
1997-01-21 15:05:15 +00:00
|
|
|
365 day years.
|
|
|
|
.El
|
2002-11-26 14:00:39 +00:00
|
|
|
.Bl -tag -width ".Fl C Ar class"
|
1997-01-21 15:05:15 +00:00
|
|
|
.It Fl E
|
2002-11-26 14:00:39 +00:00
|
|
|
Cause
|
2000-03-26 14:37:47 +00:00
|
|
|
.Nm
|
1997-01-21 15:05:15 +00:00
|
|
|
to completely ignore the environment it inherits.
|
|
|
|
.It Fl a
|
2002-11-26 14:00:39 +00:00
|
|
|
Force all resource settings to be displayed even if
|
1997-01-21 15:05:15 +00:00
|
|
|
other specific resource settings have been specified.
|
|
|
|
For example, if you wish to disable core dumps when starting up
|
2002-11-26 14:00:39 +00:00
|
|
|
the Usenet News system, but wish to set all other resource settings
|
|
|
|
as well that apply to the
|
|
|
|
.Dq Li news
|
|
|
|
account, you might use:
|
1997-01-21 15:05:15 +00:00
|
|
|
.Pp
|
2002-11-26 14:00:39 +00:00
|
|
|
.Dl "eval `limits -U news -aBec 0`"
|
1997-01-21 15:05:15 +00:00
|
|
|
.Pp
|
2001-07-15 08:06:20 +00:00
|
|
|
As with the
|
1999-08-14 06:39:48 +00:00
|
|
|
.Xr setrlimit 2
|
2002-11-26 14:00:39 +00:00
|
|
|
call, only the superuser may raise process
|
|
|
|
.Dq hard
|
|
|
|
resource limits.
|
|
|
|
Non-root users may, however, lower them or change
|
|
|
|
.Dq soft
|
|
|
|
resource limits
|
1997-01-21 15:05:15 +00:00
|
|
|
within to any value below the hard limit.
|
|
|
|
When invoked to execute a program, the failure of
|
2000-03-26 14:37:47 +00:00
|
|
|
.Nm
|
1997-01-21 15:05:15 +00:00
|
|
|
to raise a hard limit is considered a fatal error.
|
|
|
|
.El
|
2005-01-17 07:44:44 +00:00
|
|
|
.Sh EXIT STATUS
|
2002-04-20 12:18:28 +00:00
|
|
|
The
|
|
|
|
.Nm
|
|
|
|
utility
|
2002-11-26 14:00:39 +00:00
|
|
|
exits with
|
|
|
|
.Dv EXIT_FAILURE
|
2004-07-02 22:22:35 +00:00
|
|
|
if usage is incorrect in any way; i.e., an invalid
|
1997-01-21 15:05:15 +00:00
|
|
|
option, or set/display options are selected in the same invocation,
|
|
|
|
.Fl e
|
|
|
|
is used when running a program, etc.
|
|
|
|
When run in display or eval mode,
|
2000-03-26 14:37:47 +00:00
|
|
|
.Nm
|
2002-11-26 14:00:39 +00:00
|
|
|
exits with a status of
|
|
|
|
.Dv EXIT_SUCCESS .
|
1997-01-21 15:05:15 +00:00
|
|
|
When run in command mode and execution of the command succeeds, the exit status
|
|
|
|
will be whatever the executed program returns.
|
2020-06-25 16:46:27 +00:00
|
|
|
.Sh EXAMPLES
|
|
|
|
Show current stack size limit:
|
|
|
|
.Bd -literal -offset indent
|
|
|
|
$ limits -s
|
|
|
|
Resource limits (current):
|
|
|
|
stacksize 524288 kB
|
|
|
|
.Ed
|
|
|
|
.Pp
|
|
|
|
Try to run
|
|
|
|
.Xr ls 1
|
|
|
|
with 1 byte of
|
|
|
|
.Va datasize
|
|
|
|
limit:
|
|
|
|
.Bd -literal -offset indent
|
|
|
|
$ limits -d 1b ls
|
|
|
|
Data segment size exceeds process limit
|
|
|
|
Abort trap
|
|
|
|
.Ed
|
|
|
|
.Pp
|
|
|
|
Produce
|
|
|
|
.Ql eval mode
|
|
|
|
output to limit
|
|
|
|
.Va sbsize
|
|
|
|
to 1 byte.
|
|
|
|
Output obtained when command is run from
|
|
|
|
.Xr sh 1 :
|
|
|
|
.Bd -literal -offset indent
|
|
|
|
$ limits -e -b 1b
|
|
|
|
ulimit -b 512;
|
|
|
|
.Ed
|
|
|
|
.Pp
|
|
|
|
Same as above from
|
|
|
|
.Xr csh 1
|
|
|
|
.Bd -literal -offset indent
|
|
|
|
% limits -e -b 1b
|
|
|
|
limit -h sbsize 512;
|
|
|
|
limit sbsize 512;
|
|
|
|
.Ed
|
1997-01-21 15:05:15 +00:00
|
|
|
.Sh SEE ALSO
|
|
|
|
.Xr csh 1 ,
|
|
|
|
.Xr env 1 ,
|
|
|
|
.Xr limit 1 ,
|
|
|
|
.Xr sh 1 ,
|
1998-05-08 14:46:23 +00:00
|
|
|
.Xr getrlimit 2 ,
|
|
|
|
.Xr setrlimit 2 ,
|
1997-01-21 15:05:15 +00:00
|
|
|
.Xr login_cap 3 ,
|
1999-03-15 15:36:56 +00:00
|
|
|
.Xr login.conf 5 ,
|
2011-04-10 10:17:01 +00:00
|
|
|
.Xr rctl 8 ,
|
1999-03-15 15:36:56 +00:00
|
|
|
.Xr sysctl 8
|
2020-06-18 13:19:56 +00:00
|
|
|
.Sh HISTORY
|
|
|
|
The
|
|
|
|
.Nm
|
|
|
|
utility first appeared in
|
|
|
|
.Fx 2.1.7 .
|
|
|
|
.Sh AUTHORS
|
|
|
|
The
|
|
|
|
.Nm
|
|
|
|
utility was written by
|
2020-06-25 16:46:27 +00:00
|
|
|
.An David Nugent Aq Mt davidn@FreeBSD.org .
|
1997-01-21 15:05:15 +00:00
|
|
|
.Sh BUGS
|
2002-04-20 12:18:28 +00:00
|
|
|
The
|
|
|
|
.Nm
|
2002-11-26 14:00:39 +00:00
|
|
|
utility does not handle commands with equal
|
|
|
|
.Pq Ql =
|
|
|
|
signs in their
|
1997-01-21 15:05:15 +00:00
|
|
|
names, for obvious reasons.
|
|
|
|
.Pp
|
2002-04-20 12:18:28 +00:00
|
|
|
The
|
|
|
|
.Nm
|
|
|
|
utility makes no effort to ensure that resource settings emitted or displayed
|
1997-01-21 15:05:15 +00:00
|
|
|
are valid and settable by the current user.
|
1997-07-16 11:35:18 +00:00
|
|
|
Only a superuser account may raise hard limits, and when doing so
|
2000-03-26 14:37:47 +00:00
|
|
|
the
|
|
|
|
.Fx
|
|
|
|
kernel will silently lower limits to values less than
|
1997-01-21 15:05:15 +00:00
|
|
|
specified if the values given are too high.
|