/*
* 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 <errno.h>
#include "lastcomm.h"
/* ARGSUSED1 */
static void
{
"corrupted exacct file\n"));
exit(1);
}
}
static int
{
int j;
break;
return (j == argc);
}
static void
{
uint_t i;
double cpu_usr_secs = 0.;
double cpu_usr_nsecs = 0.;
double cpu_sys_secs = 0.;
double cpu_sys_nsecs = 0.;
double totalsecs;
for (i = 0; i < nobjs; i++) {
"corrupted exacct file\n"));
exit(1);
}
switch (curr_obj.eo_catalog) {
break;
break;
break;
break;
break;
break;
break;
break;
break;
break;
default:
break;
}
}
"corrupted exacct file\n"));
exit(1);
}
/*
* If a 64-bit kernel returns a major or minor value that would exceed
* the capacity of a 32-bit dev_t (and these also become visible in the
* filesystem), then the 32-bit makedev may be inaccurate and return
* NODEV. When this occurs, we can remedy the problem by providing
* either a function which returns "dev64_t"'s or by providing an LP64
* version of lastcomm.
*/
/*
* If this record doesn't match the optional arguments, go on to the
* next record.
*/
return;
(void) printf("%-*.*s %s %-*s %-*s %6.2f secs %.16s\n",
}
int
{
switch (ea_error()) {
case EXR_CORRUPT_FILE:
"exacct file corrupted\n"));
break;
case EXR_SYSCALL_FAIL:
"cannot open %s: %s\n"), filename,
break;
default:
break;
}
return (1);
}
"exacct file corrupted\n"));
exit(1);
}
/*
* lc_exacct(), in parsing the extended process accounting file,
* has knowledge of the fact that process records are top-level
* records.
*/
if (curr_obj.eo_catalog ==
else
}
/*
* Back up to the head of the object we just consumed.
*/
break;
"exacct file corrupted\n"));
exit(1);
}
}
"exacct file corrupted\n"));
exit(1);
}
return (0);
}