* Copyright (c) 1991 The Regents of the University of California.
* This code is derived from software contributed to Berkeley by
* James W. Williams of the University of Maryland.
* %sccs.include.redist.c%
"@(#) Copyright (c) 1991 The Regents of the University of California.\n\
static char sccsid
[] = "@(#)cksum.c 5.3 (Berkeley) %G%";
register int ch
, fd
, rval
;
int (*cfncn
) __P((int, unsigned long *, unsigned long *));
void (*pfncn
) __P((char *, unsigned long, unsigned long));
while ((ch
= getopt(argc
, argv
, "o:")) != EOF
)
} else if (*optarg
== '2') {
"cksum: illegal argument to -o option\n");
if ((fd
= open(fn
, O_RDONLY
, 0)) < 0) {
"cksum: %s: %s\n", fn
, strerror(errno
));
if (cfncn(fd
, &val
, &len
)) {
"cksum: %s: %s\n", fn
, strerror(errno
));
(void)fprintf(stderr
, "usage: cksum [-o 1 | 2] [file ...]\n");