/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (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 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
* Copyright (c) 2013, Joyent, Inc. All rights reserved.
*/
#include <kvm.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <unistd.h>
#include <limits.h>
#include <fcntl.h>
#include <strings.h>
#include <errno.h>
#include <sys/sysmacros.h>
struct _kvmd {
char *kvm_debug;
int kvm_openflag;
int kvm_corefd;
int kvm_kmemfd;
int kvm_memfd;
char *kvm_core;
};
static kvm_t *
{
}
return (NULL);
}
/*ARGSUSED*/
kvm_t *
{
}
} else {
"(bad magic number %x)", corefile,
"libkvm version (%u) != corefile version (%u)",
"cannot examine with %d-bit libkvm", corefile,
/*
* We try to mmap(2) the entire corefile for performance
* (so we can use bcopy(3C) rather than pread(2)). Failing
* that, we insist on at least mmap(2)ing the dump map.
*/
}
}
}
return (NULL); /* fail() already called */
}
(void) kvm_setproc(kd);
return (kd);
}
int
{
if (kd->kvm_namelist_core)
return (0);
}
const char *
{
return (kd->kvm_namelist);
}
int
{
}
/*
* If we don't have a name list, try to dig it out of the kernel crash dump.
* (The symbols have been present in the dump, uncompressed, for nearly a
* decade as of this writing -- and it is frankly surprising that the archaic
* notion of a disjoint symbol table managed to survive that change.)
*/
static int
{
return (-1);
}
return (-1);
}
/*
* Beause this temporary file may be left as a turd if the caller
* does not properly call kvm_close(), we make sure that it clearly
* indicates its origins.
*/
return (-1);
}
do {
return (-1);
}
return (-1);
}
return (0);
}
static offset_t
{
long first = 0;
break;
}
else
}
} else {
while (off != 0) {
hash) {
return (0);
}
break;
}
}
}
return (off);
}
static ssize_t
{
/*
*/
if (size == 0)
return (0);
int procfd;
return (-1);
return (rval);
}
while (resid != 0) {
break;
break;
}
}
{
}
{
}
{
}
{
}
{
}
{
}
{
}
{
}
{
}
{
}
{
} else {
long pfn_index =
}
}
return (-1ULL);
}
struct proc *
{
(void) kvm_setproc(kd);
return (NULL);
}
struct proc *
{
return (NULL);
}
int
{
return (0);
}
/*ARGSUSED*/
struct user *
{
return (&p->p_user);
}