diff --git a/usr.bin/systat/cmds.c b/usr.bin/systat/cmds.c index 4eb30fbfb4d3..075af9784562 100644 --- a/usr.bin/systat/cmds.c +++ b/usr.bin/systat/cmds.c @@ -1,4 +1,4 @@ -/* $NetBSD: cmds.c,v 1.6 1996/12/21 09:16:35 matthias Exp $ */ +/* $NetBSD: cmds.c,v 1.7 1997/07/21 07:04:56 mrg Exp $ */ /*- * Copyright (c) 1980, 1992, 1993 @@ -33,11 +33,12 @@ * SUCH DAMAGE. */ +#include #ifndef lint #if 0 static char sccsid[] = "@(#)cmds.c 8.2 (Berkeley) 4/29/95"; #endif -static char rcsid[] = "$NetBSD: cmds.c,v 1.6 1996/12/21 09:16:35 matthias Exp $"; +__RCSID("$NetBSD: cmds.c,v 1.7 1997/07/21 07:04:56 mrg Exp $"); #endif /* not lint */ #include @@ -160,7 +161,7 @@ lookup(name) longest = 0; nmatches = 0; found = (struct cmdtab *) 0; - for (c = cmdtab; p = c->c_name; c++) { + for (c = cmdtab; (p = c->c_name); c++) { for (q = name; *q == *p++; q++) if (*q == 0) /* exact match? */ return (c); diff --git a/usr.bin/systat/cmdtab.c b/usr.bin/systat/cmdtab.c index dc198d9cb744..43f562853d15 100644 --- a/usr.bin/systat/cmdtab.c +++ b/usr.bin/systat/cmdtab.c @@ -1,4 +1,4 @@ -/* $NetBSD: cmdtab.c,v 1.3 1996/12/13 19:26:19 scottr Exp $ */ +/* $NetBSD: cmdtab.c,v 1.4 1997/07/21 07:04:57 mrg Exp $ */ /*- * Copyright (c) 1980, 1992, 1993 @@ -33,11 +33,12 @@ * SUCH DAMAGE. */ +#include #ifndef lint #if 0 static char sccsid[] = "@(#)cmdtab.c 8.1 (Berkeley) 6/6/93"; #endif -static char rcsid[] = "$NetBSD: cmdtab.c,v 1.3 1996/12/13 19:26:19 scottr Exp $"; +__RCSID("$NetBSD: cmdtab.c,v 1.4 1997/07/21 07:04:57 mrg Exp $"); #endif /* not lint */ #include "systat.h" diff --git a/usr.bin/systat/disks.c b/usr.bin/systat/disks.c index 348022ace907..7b7a210baea4 100644 --- a/usr.bin/systat/disks.c +++ b/usr.bin/systat/disks.c @@ -1,4 +1,4 @@ -/* $NetBSD: disks.c,v 1.4 1996/05/10 23:16:33 thorpej Exp $ */ +/* $NetBSD: disks.c,v 1.5 1997/07/21 07:04:59 mrg Exp $ */ /*- * Copyright (c) 1980, 1992, 1993 @@ -33,17 +33,25 @@ * SUCH DAMAGE. */ +#include #ifndef lint #if 0 static char sccsid[] = "@(#)disks.c 8.1 (Berkeley) 6/6/93"; #endif -static char rcsid[] = "$NetBSD: disks.c,v 1.4 1996/05/10 23:16:33 thorpej Exp $"; +__RCSID("$NetBSD: disks.c,v 1.5 1997/07/21 07:04:59 mrg Exp $"); #endif /* not lint */ +#include + +#include +#include +#include +#include + #include "systat.h" #include "extern.h" -static void dkselect(char *args, int truefalse, int selections[]); +static void dkselect(char *args, int truefalse, int selections[]); int dkcmd(cmd, args) @@ -75,7 +83,6 @@ dkselect(args, truefalse, selections) { register char *cp; register int i; - char *index(); cp = index(args, '\n'); if (cp) diff --git a/usr.bin/systat/extern.h b/usr.bin/systat/extern.h index 5de4dce540af..2b8a0972f139 100644 --- a/usr.bin/systat/extern.h +++ b/usr.bin/systat/extern.h @@ -1,4 +1,4 @@ -/* $NetBSD: extern.h,v 1.4 1996/12/13 19:26:19 scottr Exp $ */ +/* $NetBSD: extern.h,v 1.5 1997/07/21 07:05:00 mrg Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -91,7 +91,7 @@ int initmbufs __P((void)); int initnetstat __P((void)); int initpigs __P((void)); int initswap __P((void)); -int keyboard __P((void)); +int keyboard __P((void)) __attribute__((__noreturn__)); int kvm_ckread __P((void *, void *, int)); void labeliostat __P((void)); void labelkre __P((void)); diff --git a/usr.bin/systat/fetch.c b/usr.bin/systat/fetch.c index 31f212cc8abb..326403c47992 100644 --- a/usr.bin/systat/fetch.c +++ b/usr.bin/systat/fetch.c @@ -1,4 +1,4 @@ -/* $NetBSD: fetch.c,v 1.2 1995/01/20 08:51:56 jtc Exp $ */ +/* $NetBSD: fetch.c,v 1.3 1997/07/21 07:05:01 mrg Exp $ */ /*- * Copyright (c) 1980, 1992, 1993 @@ -33,11 +33,12 @@ * SUCH DAMAGE. */ +#include #ifndef lint #if 0 static char sccsid[] = "@(#)fetch.c 8.1 (Berkeley) 6/6/93"; #endif -static char rcsid[] = "$NetBSD: fetch.c,v 1.2 1995/01/20 08:51:56 jtc Exp $"; +__RCSID("$NetBSD: fetch.c,v 1.3 1997/07/21 07:05:01 mrg Exp $"); #endif /* not lint */ #include diff --git a/usr.bin/systat/iostat.c b/usr.bin/systat/iostat.c index 3afb470b59bc..70762f82a43d 100644 --- a/usr.bin/systat/iostat.c +++ b/usr.bin/systat/iostat.c @@ -1,4 +1,4 @@ -/* $NetBSD: iostat.c,v 1.7 1997/05/24 00:48:24 jtc Exp $ */ +/* $NetBSD: iostat.c,v 1.8 1997/07/21 07:05:01 mrg Exp $ */ /* * Copyright (c) 1980, 1992, 1993 @@ -33,11 +33,12 @@ * SUCH DAMAGE. */ +#include #ifndef lint #if 0 static char sccsid[] = "@(#)iostat.c 8.1 (Berkeley) 6/6/93"; #endif -static char rcsid[] = "$NetBSD: iostat.c,v 1.7 1997/05/24 00:48:24 jtc Exp $"; +__RCSID("$NetBSD: iostat.c,v 1.8 1997/07/21 07:05:01 mrg Exp $"); #endif not lint #include @@ -70,6 +71,7 @@ static void stat1 __P((int, int)); WINDOW * openiostat() { + return (subwin(stdscr, LINES-1-5, 0, 5, 0)); } @@ -77,6 +79,7 @@ void closeiostat(w) WINDOW *w; { + if (w == NULL) return; wclear(w); @@ -87,13 +90,16 @@ closeiostat(w) int initiostat() { + dkinit(1); dkreadstats(); + return(1); } void fetchiostat() { + if (dk_ndrive == 0) return; dkreadstats(); @@ -189,7 +195,6 @@ barlabels(row) void showiostat() { - register u_int64_t t; register int i, row, col; if (dk_ndrive == 0) diff --git a/usr.bin/systat/keyboard.c b/usr.bin/systat/keyboard.c index 92c218aad748..08d0f8f40d6a 100644 --- a/usr.bin/systat/keyboard.c +++ b/usr.bin/systat/keyboard.c @@ -1,4 +1,4 @@ -/* $NetBSD: keyboard.c,v 1.3 1996/12/13 19:26:20 scottr Exp $ */ +/* $NetBSD: keyboard.c,v 1.4 1997/07/21 07:05:02 mrg Exp $ */ /*- * Copyright (c) 1980, 1992, 1993 @@ -33,11 +33,12 @@ * SUCH DAMAGE. */ +#include #ifndef lint #if 0 static char sccsid[] = "@(#)keyboard.c 8.1 (Berkeley) 6/6/93"; #endif -static char rcsid[] = "$NetBSD: keyboard.c,v 1.3 1996/12/13 19:26:20 scottr Exp $"; +__RCSID("$NetBSD: keyboard.c,v 1.4 1997/07/21 07:05:02 mrg Exp $"); #endif /* not lint */ #include diff --git a/usr.bin/systat/main.c b/usr.bin/systat/main.c index 2c098caf8ece..4f65dc6b0a53 100644 --- a/usr.bin/systat/main.c +++ b/usr.bin/systat/main.c @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.10 1997/03/03 22:19:37 explorer Exp $ */ +/* $NetBSD: main.c,v 1.11 1997/07/21 07:05:03 mrg Exp $ */ /*- * Copyright (c) 1980, 1992, 1993 @@ -33,17 +33,14 @@ * SUCH DAMAGE. */ +#include #ifndef lint -static char copyright[] = -"@(#) Copyright (c) 1980, 1992, 1993\n\ - The Regents of the University of California. All rights reserved.\n"; -#endif /* not lint */ - -#ifndef lint +__COPYRIGHT("@(#) Copyright (c) 1980, 1992, 1993\n\ + The Regents of the University of California. All rights reserved.\n"); #if 0 static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 6/6/93"; #endif -static char rcsid[] = "$NetBSD: main.c,v 1.10 1997/03/03 22:19:37 explorer Exp $"; +__RCSID("$NetBSD: main.c,v 1.11 1997/07/21 07:05:03 mrg Exp $"); #endif /* not lint */ #include @@ -55,6 +52,8 @@ static char rcsid[] = "$NetBSD: main.c,v 1.10 1997/03/03 22:19:37 explorer Exp $ #include #include #include +#include +#include #include "systat.h" #include "extern.h" @@ -86,7 +85,8 @@ int CMDLINE; static WINDOW *wload; /* one line window for load average */ -static void usage(); +static void usage __P((void)); +int main __P((int, char **)); int main(argc, argv) diff --git a/usr.bin/systat/mbufs.c b/usr.bin/systat/mbufs.c index 30ad77a0ec62..ba078cbee9cb 100644 --- a/usr.bin/systat/mbufs.c +++ b/usr.bin/systat/mbufs.c @@ -1,4 +1,4 @@ -/* $NetBSD: mbufs.c,v 1.3 1997/05/24 00:48:26 jtc Exp $ */ +/* $NetBSD: mbufs.c,v 1.4 1997/07/21 07:05:04 mrg Exp $ */ /*- * Copyright (c) 1980, 1992, 1993 @@ -33,11 +33,12 @@ * SUCH DAMAGE. */ +#include #ifndef lint #if 0 static char sccsid[] = "@(#)mbufs.c 8.1 (Berkeley) 6/6/93"; #endif -static char rcsid[] = "$NetBSD: mbufs.c,v 1.3 1997/05/24 00:48:26 jtc Exp $"; +__RCSID("$NetBSD: mbufs.c,v 1.4 1997/07/21 07:05:04 mrg Exp $"); #endif /* not lint */ #include diff --git a/usr.bin/systat/netcmds.c b/usr.bin/systat/netcmds.c index 3830a02a35a3..5801237acd59 100644 --- a/usr.bin/systat/netcmds.c +++ b/usr.bin/systat/netcmds.c @@ -1,4 +1,4 @@ -/* $NetBSD: netcmds.c,v 1.4 1995/05/21 17:14:38 mycroft Exp $ */ +/* $NetBSD: netcmds.c,v 1.5 1997/07/21 07:05:05 mrg Exp $ */ /*- * Copyright (c) 1980, 1992, 1993 @@ -33,11 +33,12 @@ * SUCH DAMAGE. */ +#include #ifndef lint #if 0 static char sccsid[] = "@(#)netcmds.c 8.1 (Berkeley) 6/6/93"; #endif -static char rcsid[] = "$NetBSD: netcmds.c,v 1.4 1995/05/21 17:14:38 mycroft Exp $"; +__RCSID("$NetBSD: netcmds.c,v 1.5 1997/07/21 07:05:05 mrg Exp $"); #endif /* not lint */ /* @@ -74,7 +75,7 @@ static struct hitem { int nports, nhosts, protos; static void changeitems __P((char *, int)); -static int selectproto __P((char *)); +static void selectproto __P((char *)); static void showprotos __P((void)); static int selectport __P((long, int)); static void showports __P((void)); @@ -131,7 +132,6 @@ changeitems(args, onoff) struct servent *sp; struct hostent *hp; struct in_addr in; - char *index(); cp = index(args, '\n'); if (cp) @@ -164,19 +164,17 @@ changeitems(args, onoff) } } -static int +static void selectproto(proto) char *proto; { - int new = protos; if (proto == 0 || streq(proto, "all")) - new = TCP|UDP; + protos = TCP|UDP; else if (streq(proto, "tcp")) - new = TCP; + protos = TCP; else if (streq(proto, "udp")) - new = UDP; - return (new != protos, protos = new); + protos = UDP; } static void @@ -246,7 +244,7 @@ showports() for (p = ports; p < ports+nports; p++) { sp = getservbyport(p->port, - protos == TCP|UDP ? 0 : protos == TCP ? "tcp" : "udp"); + protos == (TCP|UDP) ? 0 : protos == TCP ? "tcp" : "udp"); if (!p->onoff) addch('!'); if (sp) diff --git a/usr.bin/systat/netstat.c b/usr.bin/systat/netstat.c index 2fcaf331add5..77fc7e8eb28b 100644 --- a/usr.bin/systat/netstat.c +++ b/usr.bin/systat/netstat.c @@ -1,4 +1,4 @@ -/* $NetBSD: netstat.c,v 1.6 1997/05/24 00:48:28 jtc Exp $ */ +/* $NetBSD: netstat.c,v 1.7 1997/07/21 07:05:06 mrg Exp $ */ /*- * Copyright (c) 1980, 1992, 1993 @@ -33,11 +33,12 @@ * SUCH DAMAGE. */ +#include #ifndef lint #if 0 static char sccsid[] = "@(#)netstat.c 8.1 (Berkeley) 6/6/93"; #endif -static char rcsid[] = "$NetBSD: netstat.c,v 1.6 1997/05/24 00:48:28 jtc Exp $"; +__RCSID("$NetBSD: netstat.c,v 1.7 1997/07/21 07:05:06 mrg Exp $"); #endif /* not lint */ /* @@ -50,7 +51,10 @@ static char rcsid[] = "$NetBSD: netstat.c,v 1.6 1997/05/24 00:48:28 jtc Exp $"; #include #include + +#include #include + #include #include #include @@ -114,8 +118,9 @@ static struct { static int aflag = 0; static int nflag = 0; static int lastrow = 1; -static void enter(), inetprint(); -static char *inetname(); +static void enter __P((struct inpcb *, struct socket *, int, char *)); +static void inetprint __P((struct in_addr *, int, char *)); +static char *inetname __P((struct in_addr)); void closenetstat(w) @@ -198,7 +203,7 @@ again: while (next != head) { KREAD(next, &inpcb, sizeof (inpcb)); if (inpcb.inp_queue.cqe_prev != prev) { -printf("prev = %x, head = %x, next = %x, inpcb...prev = %x\n", prev, head, next, inpcb.inp_queue.cqe_prev); +printf("prev = %p, head = %p, next = %p, inpcb...prev = %p\n", prev, head, next, inpcb.inp_queue.cqe_prev); p = netcb.ni_forw; for (; p != (struct netinfo *)&netcb; p = p->ni_forw) p->ni_seen = 1; @@ -230,8 +235,8 @@ printf("prev = %x, head = %x, next = %x, inpcb...prev = %x\n", prev, head, next, static void enter(inp, so, state, proto) - register struct inpcb *inp; - register struct socket *so; + struct inpcb *inp; + struct socket *so; int state; char *proto; { @@ -378,12 +383,12 @@ shownetstat() */ static void inetprint(in, port, proto) - register struct in_addr *in; + struct in_addr *in; int port; char *proto; { struct servent *sp = 0; - char line[80], *cp, *index(); + char line[80], *cp; sprintf(line, "%.*s.", 16, inetname(*in)); cp = index(line, '\0'); diff --git a/usr.bin/systat/pigs.c b/usr.bin/systat/pigs.c index f7182aad1d0e..e721687089cc 100644 --- a/usr.bin/systat/pigs.c +++ b/usr.bin/systat/pigs.c @@ -1,4 +1,4 @@ -/* $NetBSD: pigs.c,v 1.5 1997/05/24 00:48:29 jtc Exp $ */ +/* $NetBSD: pigs.c,v 1.6 1997/07/21 07:05:07 mrg Exp $ */ /*- * Copyright (c) 1980, 1992, 1993 @@ -33,11 +33,12 @@ * SUCH DAMAGE. */ +#include #ifndef lint #if 0 static char sccsid[] = "@(#)pigs.c 8.2 (Berkeley) 9/23/93"; #endif -static char rcsid[] = "$NetBSD: pigs.c,v 1.5 1997/05/24 00:48:29 jtc Exp $"; +__RCSID("$NetBSD: pigs.c,v 1.6 1997/07/21 07:05:07 mrg Exp $"); #endif /* not lint */ /* @@ -131,7 +132,7 @@ showpigs() wmove(wnd, y, 0); wclrtoeol(wnd); mvwaddstr(wnd, y, 0, uname); - sprintf(pidname, "%10.10s", pname, 0); + sprintf(pidname, "%10.10s", pname); mvwaddstr(wnd, y, 9, pidname); wmove(wnd, y, 20); for (j = pt[k].pt_pctcpu*factor + 0.5; j > 0; j--) diff --git a/usr.bin/systat/systat.h b/usr.bin/systat/systat.h index e08f5364beaf..0f3aff65d8c8 100644 --- a/usr.bin/systat/systat.h +++ b/usr.bin/systat/systat.h @@ -1,4 +1,4 @@ -/* $NetBSD: systat.h,v 1.2 1995/01/20 08:52:14 jtc Exp $ */ +/* $NetBSD: systat.h,v 1.3 1997/07/21 07:05:08 mrg Exp $ */ /*- * Copyright (c) 1980, 1989, 1992, 1993 @@ -38,15 +38,15 @@ #include struct cmdtab { - char *c_name; /* command name */ - void (*c_refresh)(); /* display refresh */ - void (*c_fetch)(); /* sets up data structures */ - void (*c_label)(); /* label display */ - int (*c_init)(); /* initialize namelist, etc. */ - WINDOW *(*c_open)(); /* open display */ - void (*c_close)(); /* close display */ - int (*c_cmd)(); /* display command interpreter */ - char c_flags; /* see below */ + char *c_name; /* command name */ + void (*c_refresh) __P((void)); /* display refresh */ + void (*c_fetch) __P((void)); /* sets up data structures */ + void (*c_label) __P((void)); /* label display */ + int (*c_init) __P((void)); /* initialize namelist, etc. */ + WINDOW *(*c_open) __P((void)); /* open display */ + void (*c_close) __P((WINDOW *)); /* close display */ + int (*c_cmd) __P((char *, char *)); /* display command interpreter*/ + char c_flags; /* see below */ }; #define CF_INIT 0x1 /* been initialized */ @@ -60,3 +60,6 @@ struct cmdtab { #define NPTR(indx) (void *)NVAL((indx)) #define NREAD(indx, buf, len) kvm_ckread(NPTR((indx)), (buf), (len)) #define LONG (sizeof (long)) + +void dkreadstats __P((void)); /* XXX: from ../vmstat/dkstats.c */ +void dkswap __P((void)); /* XXX: from ../vmstat/dkstats.c */ diff --git a/usr.bin/systat/vmstat.c b/usr.bin/systat/vmstat.c index 66464a2ba9da..e36c04603059 100644 --- a/usr.bin/systat/vmstat.c +++ b/usr.bin/systat/vmstat.c @@ -1,4 +1,4 @@ -/* $NetBSD: vmstat.c,v 1.7 1996/12/13 19:26:23 scottr Exp $ */ +/* $NetBSD: vmstat.c,v 1.8 1997/07/21 07:05:10 mrg Exp $ */ /*- * Copyright (c) 1983, 1989, 1992, 1993 @@ -33,11 +33,12 @@ * SUCH DAMAGE. */ +#include #ifndef lint #if 0 static char sccsid[] = "@(#)vmstat.c 8.2 (Berkeley) 1/12/94"; #endif -static char rcsid[] = "$NetBSD: vmstat.c,v 1.7 1996/12/13 19:26:23 scottr Exp $"; +__RCSID("$NetBSD: vmstat.c,v 1.8 1997/07/21 07:05:10 mrg Exp $"); #endif /* not lint */ /*