* Copyright (c) 1991, 1993
* The Regents of the University of California. All rights reserved.
* This code is derived from software contributed to Berkeley by
* James W. Williams of NASA Goddard Space Flight Center.
* %sccs.include.redist.c%
static char copyright
[] =
"@(#) Copyright (c) 1991, 1993\n\
The Regents of the University of California. All rights reserved.\n";
static char sccsid
[] = "@(#)cksum.c 8.1 (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) {
(void)fprintf(stderr
, "cksum: %s: %s\n",
if (cfncn(fd
, &val
, &len
)) {
(void)fprintf(stderr
, "cksum: %s: %s\n",
fn
? fn
: "stdin", strerror(errno
));
(void)fprintf(stderr
, "usage: cksum [-o 1 | 2] [file ...]\n");