/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#include <stdio.h>
#include <stdio_ext.h>
#include <stdlib.h>
#include <unistd.h>
#include <ctype.h>
#include <string.h>
#include <limits.h>
#include <libproc.h>
#include <proc_service.h>
static char *command;
int
{
int rc = 0;
int opt;
int errflg = 0;
int Fflag = 0;
int lflag = 0;
command++;
else
/* options */
switch (opt) {
case 'F': /* force grabbing (no O_EXCL) */
Fflag = PGRAB_FORCE;
break;
case 'l': /* show unresolved link map names */
lflag = 1;
break;
default:
errflg = 1;
break;
}
}
"usage:\t%s [-Fl] { pid | core } ...\n", command);
" (report process dynamic libraries)\n");
" -F: force grabbing of the target process\n"
" -l: show unresolved dynamic linker map names\n");
return (2);
}
/*
* Make sure we'll have enough file descriptors to handle a target
* that has many many mappings.
*/
}
(void) proc_initstdio();
while (argc-- > 0) {
char *arg;
int gcode;
(void) proc_flushstdio();
rc++;
continue;
}
rc++;
continue;
}
(void) printf("core '%s' of %d:\t%.70s\n",
} else {
(void) printf("%d:\t%.70s\n",
}
"to initialize; shared library information will "
"not be available\n", command);
}
if (lflag)
else
}
(void) proc_finistdio();
return (rc);
}
static int
{
int len;
/* omit the executable file */
return (0);
/* also omit the dynamic linker */
return (0);
break;
}
auxv++;
}
}
/* freedom from symlinks; canonical form */
else
return (0);
}