diff options
| -rw-r--r-- | usr/src/lib/libproc/common/Pcontrol.c | 14 | ||||
| -rw-r--r-- | usr/src/lib/libproc/common/libproc.h | 3 |
2 files changed, 17 insertions, 0 deletions
diff --git a/usr/src/lib/libproc/common/Pcontrol.c b/usr/src/lib/libproc/common/Pcontrol.c index 9e3c26fc04..fd4e10fb74 100644 --- a/usr/src/lib/libproc/common/Pcontrol.c +++ b/usr/src/lib/libproc/common/Pcontrol.c @@ -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 @@ again: /* Come back here if we lose it in the Window of Vulnerability */ 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 @@ again: /* Come back here if we lose it in the Window of Vulnerability */ 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 @@ again: /* Come back here if we lose it in the Window of Vulnerability */ 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 @@ Pgrab_error(int error) case G_BADLWPS: str = "bad lwp specification"; break; + case G_NOFD: + str = "too many open files"; + break; default: str = "unknown error"; break; diff --git a/usr/src/lib/libproc/common/libproc.h b/usr/src/lib/libproc/common/libproc.h index 07c6ee1622..e12d41f3ae 100644 --- a/usr/src/lib/libproc/common/libproc.h +++ b/usr/src/lib/libproc/common/libproc.h @@ -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 @@ extern int _libproc_no_qsort; /* set non-zero to inhibit sorting */ #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 */ |
