/*
* 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 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#include <stdlib.h>
#include <libelf.h>
#include <libgen.h>
#include <string.h>
#include <strings.h>
#include <errno.h>
#include <sys/sysmacros.h>
#include "libproc.h"
#include "Pcontrol.h"
static ssize_t
{
while (resid > 0) {
break;
break;
}
return (n - resid);
}
/*ARGSUSED*/
static ssize_t
{
return (-1);
}
};
static int
{
dprintf("mapping base %llx filesz %llu memsz %llu offset %llu\n",
sizeof (pmap.pr_mapname));
pmap.pr_pagesize = 0;
}
struct ps_prochandle *
{
struct ps_prochandle *P = NULL;
int fd;
int i;
dprintf("couldn't open file");
return (NULL);
}
dprintf("libproc ELF version is more recent than libelf");
goto err;
}
goto err;
}
P->ctlfd = -1;
P->statfd = -1;
P->agentctlfd = -1;
P->agentstatfd = -1;
P->info_valid = -1;
P->ops = &P_idle_ops;
Pinitsym(P);
return (NULL);
}
/*
* Construct a file_info_t that corresponds to this file.
*/
goto err;
}
goto err;
}
if (*fname == '/') {
} else {
NULL) {
goto err;
}
}
goto err;
}
goto err;
}
P->num_files++;
goto err;
}
goto err;
}
/*
* Sift through the program headers making the relevant maps.
*/
for (i = 0; i < phnum; i++) {
goto err;
}
continue;
goto err;
}
}
Psort_mappings(P);
case ELFCLASS32:
break;
case ELFCLASS64:
break;
default:
goto err;
}
/*
* Pfindobj() checks what zone a process is associated with, so
* we call it after initializing pr_zoneid to -1. This ensures
* we don't get associated with any zone on the system.
*/
}
/*
* The file and map lists are complete, and will never need to be
* adjusted.
*/
P->info_valid = 1;
return (P);
err:
if (P != NULL)
Pfree(P);
return (NULL);
}