Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F144566011
D54273.1775488573.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D54273.1775488573.diff
View Options
Index: usr.bin/limits/limits.1
===================================================================
--- usr.bin/limits/limits.1
+++ usr.bin/limits/limits.1
@@ -17,7 +17,7 @@
.\" 5. Modifications may be freely made to this file providing the above
.\" conditions are met.
.\"
-.Dd June 25, 2020
+.Dd December 17, 2025
.Dt LIMITS 1
.Os
.Sh NAME
@@ -28,11 +28,11 @@
.Op Fl C Ar class | Fl P Ar pid | Fl U Ar user
.Op Fl SHB
.Op Fl ea
-.Op Fl bcdfklmnopstuvw Op Ar val
+.Op Fl bcdfklmnopstuVvwy Op Ar val
.Nm
.Op Fl C Ar class | Fl U Ar user
.Op Fl SHB
-.Op Fl bcdfklmnopstuvwy Op Ar val
+.Op Fl bcdfklmnopstuVvwy Op Ar val
.Op Fl E
.Oo
.Op Ar name Ns = Ns Ar value ...
@@ -265,6 +265,10 @@
.Va kern.maxproc
.Xr sysctl 8
variable.
+.It Fl V Op Ar val
+Select or set the
+.Va vmms
+resource limit.
.It Fl v Op Ar val
Select or set the
.Va virtualmem
Index: usr.bin/limits/limits.c
===================================================================
--- usr.bin/limits/limits.c
+++ usr.bin/limits/limits.c
@@ -228,7 +228,7 @@
static struct {
const char * cap;
rlim_t (*func)(login_cap_t *, const char *, rlim_t, rlim_t);
-} resources[RLIM_NLIMITS] = {
+} resources[] = {
{ "cputime", login_getcaptime },
{ "filesize", login_getcapsize },
{ "datasize", login_getcapsize },
@@ -245,8 +245,12 @@
{ "kqueues", login_getcapnum },
{ "umtxp", login_getcapnum },
{ "pipebuf", login_getcapnum },
+ { "vmms", login_getcapnum },
};
+_Static_assert(nitems(resources) == RLIM_NLIMITS,
+ "Please add entries to resources[] for the new limits");
+
/*
* One letter for each resource levels.
* NOTE: There is a dependency on the corresponding
@@ -254,8 +258,9 @@
* If sys/resource.h defines are changed, this needs
* to be modified accordingly!
*/
-
-#define RCS_STRING "tfdscmlunbvpwkoy"
+static const char rcs_string[] = "tfdscmlunbvpwkoyV";
+_Static_assert(sizeof(rcs_string) - 1 == RLIM_NLIMITS,
+ "Please add letters to rcs_string[] for the new limits");
static rlim_t resource_num(int which, int ch, const char *str);
static void usage(void) __dead2;
@@ -266,8 +271,6 @@
static void setrlimit_proc(pid_t pid, int resource, const struct rlimit *rlp);
extern char **environ;
-static const char rcs_string[] = RCS_STRING;
-
int
main(int argc, char *argv[])
{
@@ -552,7 +555,7 @@
{
(void)fprintf(stderr,
"usage: limits [-C class|-P pid|-U user] [-eaSHBE] "
- "[-bcdfklmnostuvpw [val]] [[name=val ...] cmd]\n");
+ "[-bcdfklmnostuVvpwy [val]] [[name=val ...] cmd]\n");
exit(EXIT_FAILURE);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Apr 6, 3:16 PM (11 h, 10 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28277952
Default Alt Text
D54273.1775488573.diff (2 KB)
Attached To
Mode
D54273: limits: Unbreak after RLIMIT_VMM addition
Attached
Detach File
Event Timeline
Log In to Comment