Deleted Added
full compact
swap.c (65062) swap.c (74671)
1/*-
2 * Copyright (c) 1980, 1992, 1993
3 * The Regents of the University of California. 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

--- 22 unchanged lines hidden (view full) ---

31 * SUCH DAMAGE.
32 */
33
34#ifndef lint
35#if 0
36static char sccsid[] = "@(#)swap.c 8.3 (Berkeley) 4/29/95";
37#endif
38static const char rcsid[] =
1/*-
2 * Copyright (c) 1980, 1992, 1993
3 * The Regents of the University of California. 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

--- 22 unchanged lines hidden (view full) ---

31 * SUCH DAMAGE.
32 */
33
34#ifndef lint
35#if 0
36static char sccsid[] = "@(#)swap.c 8.3 (Berkeley) 4/29/95";
37#endif
38static const char rcsid[] =
39 "$FreeBSD: head/usr.bin/systat/swap.c 65062 2000-08-24 20:22:44Z peter $";
39 "$FreeBSD: head/usr.bin/systat/swap.c 74671 2001-03-23 03:58:25Z tmm $";
40#endif /* not lint */
41
42/*
43 * swapinfo - based on a program of the same name by Kevin Lahey
44 */
45
46#include <sys/param.h>
47#include <sys/ioctl.h>

--- 39 unchanged lines hidden (view full) ---

87 * The meat of all the swap stuff is stolen from pstat(8)'s
88 * swapmode(), which is based on a program called swapinfo written by
89 * Kevin Lahey <kml@rokkaku.atl.ga.us>.
90 */
91
92int
93initswap()
94{
40#endif /* not lint */
41
42/*
43 * swapinfo - based on a program of the same name by Kevin Lahey
44 */
45
46#include <sys/param.h>
47#include <sys/ioctl.h>

--- 39 unchanged lines hidden (view full) ---

87 * The meat of all the swap stuff is stolen from pstat(8)'s
88 * swapmode(), which is based on a program called swapinfo written by
89 * Kevin Lahey <kml@rokkaku.atl.ga.us>.
90 */
91
92int
93initswap()
94{
95 int i;
96 char msgbuf[BUFSIZ];
95 char msgbuf[BUFSIZ];
97 char *cp;
98 static int once = 0;
96 static int once = 0;
99 u_long ptr;
100 struct kvm_swap dummy;
101
102 if (once)
103 return (1);
104
105 if (kvm_getswapinfo(kd, &dummy, 1, 0) < 0) {
106 snprintf(msgbuf, sizeof(msgbuf), "systat: kvm_getswapinfo failed");
107 error(msgbuf);

--- 11 unchanged lines hidden (view full) ---

119fetchswap()
120{
121 kvnsw = kvm_getswapinfo(kd, kvmsw, 16, 0);
122}
123
124void
125labelswap()
126{
97 struct kvm_swap dummy;
98
99 if (once)
100 return (1);
101
102 if (kvm_getswapinfo(kd, &dummy, 1, 0) < 0) {
103 snprintf(msgbuf, sizeof(msgbuf), "systat: kvm_getswapinfo failed");
104 error(msgbuf);

--- 11 unchanged lines hidden (view full) ---

116fetchswap()
117{
118 kvnsw = kvm_getswapinfo(kd, kvmsw, 16, 0);
119}
120
121void
122labelswap()
123{
127 char *header, *p;
124 char *header;
128 int row, i;
129
130 fetchswap();
131
132 row = 0;
133 wmove(wnd, row, 0); wclrtobot(wnd);
134 header = getbsize(&hlen, &blocksize);
135 mvwprintw(wnd, row++, 0, "%-5s%*s%9s %55s",

--- 69 unchanged lines hidden ---
125 int row, i;
126
127 fetchswap();
128
129 row = 0;
130 wmove(wnd, row, 0); wclrtobot(wnd);
131 header = getbsize(&hlen, &blocksize);
132 mvwprintw(wnd, row++, 0, "%-5s%*s%9s %55s",

--- 69 unchanged lines hidden ---