Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: Notesfiles; site convex.UUCP Path: utzoo!watmath!clyde!akgua!mcnc!decvax!harpo!ihnp4!inuxc!pur-ee!uiucdcs!convex!kolstad From: kolstad@convex.UUCP Newsgroups: net.bugs.4bsd Subject: iostat overflows - (nf) Message-ID: <33500005@convex.UUCP> Date: Fri, 20-Apr-84 17:10:00 EST Article-I.D.: convex.33500005 Posted: Fri Apr 20 17:10:00 1984 Date-Received: Sun, 22-Apr-84 09:08:03 EST Lines: 16 Nf-ID: #N:convex:33500005:000:462 Nf-From: convex!kolstad Apr 20 16:10:00 1984 #N:convex:33500005:000:462 convex!kolstad Apr 20 16:10:00 1984 If your machine accumulates several days of idle time, iostat can report a negative idle percentage. This is due to an integer overflow in the print statement which computes this percent. Find the printf call in stat1 and notice that the conversion to floating point is not done until the multiply by the (integer) 100. This causes the overflow sometimes. Here's a new line which fixes the bug: printf("%3.0f", 100.0*s.cp_time[o]/time); Cheers. Rob