/*
* 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 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
* Copyright (c) 2012, 2014 by Delphix. All rights reserved.
*/
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <limits.h>
#include <errno.h>
#include <fcntl.h>
#include <string.h>
/* Initialize Globals */
static int count = 0;
static int rflag = 0;
static int seed = 0;
static int vflag = 0;
static int errflag = 0;
static void
{
"usage: %s [-b blocksize] [-c count] [-f filesize]"
" [-o offset] [-s seed] [-r] [-v] filename\n", execname);
(void) exit(1);
}
int
{
int i;
if (fd < 0) {
perror("open");
exit(3);
}
}
return (0);
}
static void
{
int c;
extern char *optarg;
switch (c) {
case 'b':
break;
case 'c':
break;
case 'f':
break;
case 'o':
break;
case 'r':
rflag++;
break;
case 's':
break;
case 'v':
vflag++;
break;
case ':':
"Option -%c requires an operand\n", optopt);
errflag++;
break;
case '?':
"Unrecognized option: -%c\n", optopt);
errflag++;
break;
}
if (errflag) {
}
}
"No filename specified\n");
}
if (vflag) {
}
}
static void
{
perror("malloc");
exit(4);
}
perror("lseek");
exit(5);
}
perror("write");
exit(6);
}
if (rflag) {
perror("lseek");
exit(7);
}
perror("read");
exit(8);
}
perror("memcmp");
exit(9);
}
}
if (vflag) {
if (rflag) {
}
}
}
static void
{
perror("truncate");
exit(7);
}
if (vflag) {
"Truncated at offset %lld\n",
}
}