/*
*
* This program is part of a stress test for ::Exacct and libexacct.
* See README for details.
*/
/* Turn largefile support on. */
#include <stdlib.h>
#include <stdio.h>
#include <strings.h>
#include <signal.h>
#include <errno.h>
#include <fcntl.h>
#include <exacct.h>
#include <exacct_impl.h>
static char *ea_errstr[] = {
"EXR_OK",
"EXR_SYSCALL_FAIL",
"EXR_CORRUPT_FILE",
"EXR_EOF",
"EXR_NO_CREATOR",
"EXR_INVALID_BUF",
"EXR_NOTSUPP",
"EXR_UNKN_VERSION",
"EXR_INVALID_OBJ",
};
{
switch (type & EXT_TYPE_MASK) {
case EXT_NONE:
return ("NONE");
case EXT_UINT8:
return ("UINT8");
case EXT_UINT16:
return ("UINT16");
case EXT_UINT32:
return ("UINT32");
case EXT_UINT64:
return ("UINT64");
case EXT_DOUBLE:
return ("DOUBLE");
case EXT_STRING:
return ("STRING");
case EXT_EXACCT_OBJECT:
return ("OBJECT");
case EXT_RAW:
return ("RAW");
case EXT_GROUP:
return ("GROUP");
default:
return ("INVALID");
}
}
{
fi = (ea_file_impl_t *)f;
log_op++;
} else {
}
"%-6d %c off=0x%-5llx depth=%-2d pos=%-7s adv=0x%-3llx %s",
} else {
}
}
}
{
int i, l;
if (ea_error() == EXR_SYSCALL_FAIL) {
}
(void) printf("\nError at offset 0x%lx: %s: %s %s\n",
if (log[l][0] != '\0') {
}
}
exit(1);
}
/* ARGSUSED */
{
exit(2);
}
static int
{
unsigned char act;
while (sz--) {
/* If reading backwards */
if (dir == 'B') {
return ('F');
} else {
die(f, "ea_previous_object");
}
}
}
/* Do a ea_next_object 50% of the time */
if (act & 0x01) {
} else {
die(f, "ea_next_object");
}
}
}
/* Do a ea_get_object 50% of the time */
if (act & 0x02) {
} else {
die(f, "ea_get_object");
}
}
}
/* If reading backwards */
if (dir == 'B') {
return ('F');
} else {
die(f, "ea_get_object");
}
}
}
}
return (' ');
}
int
{
char dir;
ea_file_t f;
if (argc != 4) {
"Usage: randtest <iters> <maxsz> <file>\n");
return (2);
}
perror("open failed");
return (1);
}
dir = 'F';
while (iters--) {
if (dir == ' ') {
}
}
(void) ea_close(&f);
return (0);
}