/*
* 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.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
#include <string.h>
#include <limits.h>
#include <stdio.h>
#include <assert.h>
#include <signal.h>
#include <libuutil.h>
#include <libintl.h>
#include <libcontract.h>
#include <libcontract_priv.h>
#include "libcontract_impl.h"
void
{
char *s;
return;
}
switch (type) {
case CT_PR_EV_EMPTY:
break;
case CT_PR_EV_FORK:
break;
case CT_PR_EV_EXIT:
break;
case CT_PR_EV_CORE:
break;
case CT_PR_EV_SIGNAL:
s = dgettext(TEXT_DOMAIN,
"process %d received a fatal signal\n");
break;
case CT_PR_EV_HWERR:
s = dgettext(TEXT_DOMAIN,
"process %d was killed by a hardware error\n");
break;
default:
break;
}
/*LINTED*/
if (!verbose)
return;
switch (type) {
int i;
const char *c;
case CT_PR_EV_FORK:
"\tparent pid: %d\n"), pid);
break;
case CT_PR_EV_EXIT:
if (ct_pr_event_get_exitstatus(ev, &i) != 0)
break;
if (WIFEXITED(i)) {
" (exited, code %d)\n"), WEXITSTATUS(i));
} else if (WIFSIGNALED(i)) {
if (WCOREDUMP(i))
else
} else {
/*
* We really shouldn't get here.
*/
}
break;
case CT_PR_EV_CORE:
if (ct_pr_event_get_pcorefile(ev, &c) == 0)
"\tprocess core: %s\n"), c);
if (ct_pr_event_get_gcorefile(ev, &c) == 0)
"\tglobal core: %s\n"), c);
if (ct_pr_event_get_zcorefile(ev, &c) == 0)
"\tglobal zone core: %s\n"), c);
break;
case CT_PR_EV_SIGNAL:
if (ct_pr_event_get_signal(ev, &i) == 0) {
"\tsignal: %d\n"), i);
else
"\tsignal: %d (SIG%s)\n"), i, buf);
}
"\tsender pid: %d\n"), pid);
"\tsender ctid: %d\n"), ctid);
break;
}
}