Mercurial > illumos > illumos-gate
changeset 5272:8987112e92c4
6277664 Pgrab() failures due to the fd rlimit are not well reported
Contributed by Chad Mynhier (cmynhier@gmail.com).
author | jhaslam |
---|---|
date | Tue, 16 Oct 2007 02:38:11 -0700 |
parents | c14cab57b07d |
children | 526a926ae3d8 |
files | usr/src/lib/libproc/common/Pcontrol.c usr/src/lib/libproc/common/libproc.h |
diffstat | 2 files changed, 17 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/usr/src/lib/libproc/common/Pcontrol.c Mon Oct 15 23:00:44 2007 -0700 +++ b/usr/src/lib/libproc/common/Pcontrol.c Tue Oct 16 02:38:11 2007 -0700 @@ -22,6 +22,8 @@ /* * Copyright 2007 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. + * + * Portions Copyright 2007 Chad Mynhier */ #pragma ident "%Z%%M% %I% %E% SMI" @@ -584,6 +586,9 @@ case EPERM: rc = G_PERM; break; + case EMFILE: + rc = G_NOFD; + break; case EBUSY: if (!(flags & PGRAB_FORCE) || geteuid() != 0) { rc = G_BUSY; @@ -607,6 +612,9 @@ case ENOENT: rc = G_NOPROC; break; + case EMFILE: + rc = G_NOFD; + break; default: dprintf("Pgrab: failed to open %s: %s\n", procname, strerror(errno)); @@ -625,6 +633,9 @@ case ENOENT: rc = G_NOPROC; break; + case EMFILE: + rc = G_NOFD; + break; default: dprintf("Pgrab: failed to open %s: %s\n", procname, strerror(errno)); @@ -905,6 +916,9 @@ case G_BADLWPS: str = "bad lwp specification"; break; + case G_NOFD: + str = "too many open files"; + break; default: str = "unknown error"; break;
--- a/usr/src/lib/libproc/common/libproc.h Mon Oct 15 23:00:44 2007 -0700 +++ b/usr/src/lib/libproc/common/libproc.h Tue Oct 16 02:38:11 2007 -0700 @@ -21,6 +21,8 @@ /* * Copyright 2007 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. + * + * Portions Copyright 2007 Chad Mynhier */ /* @@ -150,6 +152,7 @@ #define G_NOTE 14 /* Required PT_NOTE Phdr not present in core */ #define G_ISAINVAL 15 /* Wrong ELF machine type */ #define G_BADLWPS 16 /* Bad '/lwps' specification */ +#define G_NOFD 17 /* No more file descriptors */ /* Flags accepted by Prelease */