4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
23 * Copyright 1988 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
28 /* All Rights Reserved */
31 #pragma ident "%Z%%M% %I% %E% SMI"
38 Report and log file transfer rate statistics.
39 This is ugly because we are not using floating point.
43 statlog( direction
, bytes
, millisecs
, breakmsg
)
47 char *breakmsg
; /* "PARTIAL FILE" or "" */
50 unsigned long bytes1000
;
52 /* bytes1000 = bytes * 1000; */
53 /* on fast machines, times(2) resolution may not be enough */
54 /* so millisecs may be zero. just use 1 as best guess */
60 bytes1000
= (bytes
*1000/millisecs
);
62 bytes1000
= ((bytes
/millisecs
)*1000);
64 (void) sprintf(text
, "%s %lu / %lu.%.3lu secs, %lu bytes/sec %s",
65 direction
, bytes
, millisecs
/1000, millisecs
%1000,
66 bytes1000
, breakmsg
);
68 sprintf(text
+ strlen(text
), " %d retries", Retries
);
71 /* bytes1000/millisecs, breakmsg ); */
72 CDEBUG(4, "%s\n", text
);
77 static unsigned long filesize
; /* size of file been
78 transferred or received */
80 return the size of file been transferred or received
89 update the size of file been transferred or received