* Copyright (c) 1992 The Regents of the University of California.
* %sccs.include.redist.c%
static char sccsid
[] = "@(#)misc.c 5.1 (Berkeley) %G%";
err(const int fatal
, const char *fmt
, ...)
(void)fprintf(stderr
, "%s: ", special
);
(void)vfprintf(stderr
, fmt
, ap
);
(void)fprintf(stderr
, " %s\n", strerror(errno
));
if (lseek(fd
, off
, SEEK_SET
) < 0)
err(1, "%s: %s", special
, strerror(errno
));
if ((rbytes
= read(fd
, p
, len
)) < 0)
err(1, "%s: %s", special
, strerror(errno
));
err(1, "%s: short read (%d, not %d)", special
, rbytes
, len
);