diff options
author | Michael Zeller <mike@mikezeller.net> | 2020-03-31 18:39:53 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-31 18:39:53 -0400 |
commit | 88606cbe3645730adccc57e29f4b829af51c05f4 (patch) | |
tree | dbcc7285a46f80620ca723f45a54c803d24ed691 | |
parent | 78a0e8a13427b21a9acb597da969a7921c521e12 (diff) | |
download | illumos-joyent-88606cbe3645730adccc57e29f4b829af51c05f4.tar.gz |
OS-8150 lx should not report unlimited for max open files (#279)
Reviewed by: Jason King <jason.king@joyent.com>
Approved by: Jason King <jason.king@joyent.com>
-rw-r--r-- | usr/src/uts/common/brand/lx/procfs/lx_prvnops.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/usr/src/uts/common/brand/lx/procfs/lx_prvnops.c b/usr/src/uts/common/brand/lx/procfs/lx_prvnops.c index ba32aaf04e..c44c32ef29 100644 --- a/usr/src/uts/common/brand/lx/procfs/lx_prvnops.c +++ b/usr/src/uts/common/brand/lx/procfs/lx_prvnops.c @@ -470,6 +470,8 @@ typedef struct lxpr_rlimtab { char *rlim_rctl; /* rctl source */ } lxpr_rlimtab_t; +#define RLIM_MAXFD "Max open files" + static lxpr_rlimtab_t lxpr_rlimtab[] = { { "Max cpu time", "seconds", "process.max-cpu-time" }, { "Max file size", "bytes", "process.max-file-size" }, @@ -478,7 +480,7 @@ static lxpr_rlimtab_t lxpr_rlimtab[] = { { "Max core file size", "bytes", "process.max-core-size" }, { "Max resident set", "bytes", "zone.max-physical-memory" }, { "Max processes", "processes", "zone.max-lwps" }, - { "Max open files", "files", "process.max-file-descriptor" }, + { RLIM_MAXFD, "files", "process.max-file-descriptor" }, { "Max locked memory", "bytes", "zone.max-locked-memory" }, { "Max address space", "bytes", "process.max-address-space" }, { "Max file locks", "locks", NULL }, @@ -1730,6 +1732,14 @@ lxpr_read_pid_limits(lxpr_node_t *lxpnp, lxpr_uiobuf_t *uiobuf) break; } } + /* + * If "Max open files" is still set to RLIM_INFINITY, make it + * match the max value so that we do not output "unlimited". + */ + if (strcmp(lxpr_rlimtab[i].rlim_name, RLIM_MAXFD) == 0 && + cur[i] == RLIM_INFINITY) + cur[i] = max[i]; + } lxpr_unlock(p); |