iostat.c (69141) | iostat.c (74671) |
---|---|
1/* 2 * Copyright (c) 1998 Kenneth D. Merry. 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26 * SUCH DAMAGE. 27 * | 1/* 2 * Copyright (c) 1998 Kenneth D. Merry. 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26 * SUCH DAMAGE. 27 * |
28 * $FreeBSD: head/usr.bin/systat/iostat.c 69141 2000-11-25 03:47:36Z rwatson $ | 28 * $FreeBSD: head/usr.bin/systat/iostat.c 74671 2001-03-23 03:58:25Z tmm $ |
29 */ 30/* 31 * Copyright (c) 1980, 1992, 1993 32 * The Regents of the University of California. All rights reserved. 33 * 34 * Redistribution and use in source and binary forms, with or without 35 * modification, are permitted provided that the following conditions 36 * are met: --- 24 unchanged lines hidden (view full) --- 61 */ 62 63#ifndef lint 64static char sccsid[] = "@(#)iostat.c 8.1 (Berkeley) 6/6/93"; 65#endif not lint 66 67#include <sys/param.h> 68#include <sys/dkstat.h> | 29 */ 30/* 31 * Copyright (c) 1980, 1992, 1993 32 * The Regents of the University of California. All rights reserved. 33 * 34 * Redistribution and use in source and binary forms, with or without 35 * modification, are permitted provided that the following conditions 36 * are met: --- 24 unchanged lines hidden (view full) --- 61 */ 62 63#ifndef lint 64static char sccsid[] = "@(#)iostat.c 8.1 (Berkeley) 6/6/93"; 65#endif not lint 66 67#include <sys/param.h> 68#include <sys/dkstat.h> |
69#include <sys/sysctl.h> |
|
69 70#include <string.h> 71#include <stdlib.h> 72#include <nlist.h> 73#include <paths.h> 74#include <devstat.h> 75#include <err.h> 76#include "systat.h" --- 28 unchanged lines hidden (view full) --- 105 wclear(w); 106 wrefresh(w); 107 delwin(w); 108} 109 110int 111initiostat() 112{ | 70 71#include <string.h> 72#include <stdlib.h> 73#include <nlist.h> 74#include <paths.h> 75#include <devstat.h> 76#include <err.h> 77#include "systat.h" --- 28 unchanged lines hidden (view full) --- 106 wclear(w); 107 wrefresh(w); 108 delwin(w); 109} 110 111int 112initiostat() 113{ |
113 if (num_devices = getnumdevs() < 0) | 114 if ((num_devices = getnumdevs()) < 0) |
114 return(0); 115 116 cur.dinfo = (struct devinfo *)malloc(sizeof(struct devinfo)); 117 last.dinfo = (struct devinfo *)malloc(sizeof(struct devinfo)); 118 bzero(cur.dinfo, sizeof(struct devinfo)); 119 bzero(last.dinfo, sizeof(struct devinfo)); 120 121 /* --- 286 unchanged lines hidden --- | 115 return(0); 116 117 cur.dinfo = (struct devinfo *)malloc(sizeof(struct devinfo)); 118 last.dinfo = (struct devinfo *)malloc(sizeof(struct devinfo)); 119 bzero(cur.dinfo, sizeof(struct devinfo)); 120 bzero(last.dinfo, sizeof(struct devinfo)); 121 122 /* --- 286 unchanged lines hidden --- |