/*- * Copyright (c) 1991, 1993 * The Regents of the University of California. All rights reserved. * * %sccs.include.redist.c% */ #ifndef lint static char sccsid[] = "@(#)misc.c 8.1 (Berkeley) 06/05/93"; #endif /* not lint */ #include #include #include #include #include #include #include "extern.h" void get(fd, off, p, len) int fd; off_t off; void *p; size_t len; { int rbytes; if (lseek(fd, off, SEEK_SET) < 0) err("%s: %s", special, strerror(errno)); if ((rbytes = read(fd, p, len)) < 0) err("%s: %s", special, strerror(errno)); if (rbytes != len) err("%s: short read (%d, not %d)", special, rbytes, len); } #if __STDC__ #include #else #include #endif void #if __STDC__ err(const char *fmt, ...) #else err(fmt, va_alist) char *fmt; va_dcl #endif { va_list ap; #if __STDC__ va_start(ap, fmt); #else va_start(ap); #endif (void)fprintf(stderr, "dumplfs: "); (void)vfprintf(stderr, fmt, ap); va_end(ap); (void)fprintf(stderr, "\n"); exit(1); /* NOTREACHED */ }