mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-03 07:04:53 +00:00
procstat(1): make rlimit_param[] size assertion automatic
Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D46619
This commit is contained in:
parent
3a2a5d6060
commit
e3b777534b
|
@ -47,7 +47,7 @@
|
||||||
static struct {
|
static struct {
|
||||||
const char *name;
|
const char *name;
|
||||||
const char *suffix;
|
const char *suffix;
|
||||||
} rlimit_param[15] = {
|
} rlimit_param[] = {
|
||||||
{"cputime", "sec"},
|
{"cputime", "sec"},
|
||||||
{"filesize", "B "},
|
{"filesize", "B "},
|
||||||
{"datasize", "B "},
|
{"datasize", "B "},
|
||||||
|
@ -65,9 +65,8 @@ static struct {
|
||||||
{"umtxp", " "},
|
{"umtxp", " "},
|
||||||
};
|
};
|
||||||
|
|
||||||
#if RLIM_NLIMITS > 15
|
_Static_assert(nitems(rlimit_param) == RLIM_NLIMITS,
|
||||||
#error "Resource limits have grown. Add new entries to rlimit_param[]."
|
"Resource limits have grown. Add new entries to rlimit_param[].");
|
||||||
#endif
|
|
||||||
|
|
||||||
static const char *
|
static const char *
|
||||||
humanize_rlimit(int indx, rlim_t limit)
|
humanize_rlimit(int indx, rlim_t limit)
|
||||||
|
|
Loading…
Reference in a new issue