History log of /freebsd-10.0-release/usr.bin/systat/swap.c
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 259065 07-Dec-2013 gjb

- Copy stable/10 (r259064) to releng/10.0 as part of the
10.0-RELEASE cycle.
- Update __FreeBSD_version [1]
- Set branch name to -RC1

[1] 10.0-CURRENT __FreeBSD_version value ended at '55', so
start releng/10.0 at '100' so the branch is started with
a value ending in zero.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

# 256281 10-Oct-2013 gjb

Copy head (r256279) to stable/10 as part of the 10.0-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


# 216370 11-Dec-2010 joel

Remove the advertising clause from UCB copyrighted files in usr.bin. This
is in accordance with the information provided at
ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change

Also add $FreeBSD$ to a few files to keep svn happy.

Discussed with: imp, rwatson


# 200462 13-Dec-2009 delphij

Revert most part of 200420 as requested, as more review and polish is
needed.


# 200420 11-Dec-2009 delphij

Remove unneeded header includes from usr.bin/ except contributed code.

Tested with: make universe


# 175387 16-Jan-2008 delphij

ANSIfy and remove register.

Resulting binary verified with strip(1)+md5(1).


# 165506 23-Dec-2006 yar

Add missing things: a prototype and a const qualifier.

Found by: WARNS=4


# 165501 23-Dec-2006 yar

Dynamically resize the Disk column. It was too narrow for modern
disk device names such as da0s1b. So we also get rid of the nasty
constant 5 scattered over the code.

Implementing this change is a good chance to improve other bits
around it: init saved lengths early, always check return value from
kvm_getswapinfo().


# 165499 23-Dec-2006 yar

Clear to EOL after the end of meter so that its reading can decrease.


# 165498 23-Dec-2006 yar

Make it possible for meter to reach 100% mark when swap is totally full.


# 165495 23-Dec-2006 yar

Improve style:
- Don't define vars inside loops.
- Avoid useless casts.
- Use C idioms.
- Do alike things in a consistent way.


# 165493 23-Dec-2006 yar

Reposition the "(swap not configured)" sign WRT the new layout.


# 165492 23-Dec-2006 yar

Eliminate a couple of screen coordinate variables
that were useless and just obfuscated the code.


# 165491 23-Dec-2006 yar

Add some vertical whitespace for easier reading.


# 165490 23-Dec-2006 yar

Fix the swap display further:

1) Resize the Used column to avoid screen overflow if BLOCKSIZE is long.
2) Track the current swap configuration so that its changes don't break
the display.

Suggested by: bde (1)


# 165489 23-Dec-2006 yar

Fix the Total line shown if there are >1 swap devices.


# 165488 23-Dec-2006 yar

Start fixing the "swap" display by saving one horizontal position.
Now the display won't overflow the 80-char row if BLOCKSIZE=1024.
The new spacing is also consistent with the "pigs" display.


# 164689 27-Nov-2006 yar

Consistently mark percentage scales as such.

PR: bin/101975
MFC after: 3 days


# 158161 30-Apr-2006 bde

Remove trailing whitespace.

Submitted by: Se=E1n Farley <sean-freebsd at farley dot org>
PR: bin/81874


# 158160 30-Apr-2006 bde

Show the load average in the tcp display (it was already shown, perhaps
not very usefully, in all other displays). This was the original point
of the PR.

Move the load average up by 2 so that it starts in row 0 for all windows
(2 lines above it were wasted for all other windows except vmstat).
Move everything below it up by 2 or 3 (3 for icmp and icmp6 which had
an extra blank line due from not compensating for the foot-shooting in
note (3); only ip and ip6 compensated). Reduce the magic numbers related
to this.

Notes by the submitter:
%%%
1. All the subwin() calls are identical using #define MAINWIN_ROW 3
(systat.h).
2. The load average is at the top of the window.
3. Each display starts on the fourth line. I made changes to those
displays that shifted the start line (i.e., icmp). This entailed a
lot of changes within the comments at the top of those displays.
4. For ip6, I shifted the "Input next-header histogram" column down one
row to separate it from "IPv6 Output". I raised "bad scope packets"
and "address selection failed" up one row to stay with "IPv6 Input"
(valid?). They were down one row to probably line up at the bottom,
but I think they should stick with their fellow items in a column.
5. I condensed ifstat a bit. It had a lot of empty rows.
%%%

Submitted by: Se=E1n Farley <sean-freebsd at farley dot org>
PR: bin/81874


# 108454 30-Dec-2002 mike

Back out rev 1.20; getbsize(3)'s original interface has been restored.

Approved by: markm


# 105812 23-Oct-2002 markm

Adjust for getbsize argument type change.


# 105807 23-Oct-2002 markm

Remove unneeded function prototypes.


# 92922 21-Mar-2002 imp

remove __P


# 87715 11-Dec-2001 markm

WARNS=2 fixes with NO_WERROR set, as there are some header issues
with namelists. use __FBSDID().


# 77206 25-May-2001 kris

Mark error() as __printflike() and fix a non-exploitable format string
error.

MFC after: 1 week


# 74671 23-Mar-2001 tmm

Get rid of setgid kmem for systat, and while being there, fix some bugs
and compiler warnings.
The data for network statistics are still obtained via the kvm interface
if systat was started with the needed privileges, otherwise sysctls are
used. The reason for this is that with really many open sockets, the
sysctl method is probably slower, but it systat -netstat is probably not
really usable in either mode under these conditions.

Approved by: rwatson


# 65062 24-Aug-2000 peter

Quick Fix: swap.c doesn't appear to actually need <sys/conf.h>, so remove
it to try and get world building again. (sys/conf.h now depends on
sys/types.h)


# 60049 05-May-2000 phk

Don't include <sys/buf.h>


# 50477 27-Aug-1999 peter

$Id$ -> $FreeBSD$


# 47018 11-May-1999 peter

Tidy up references to <sys/rlist.h> and support for the old swap management
that went away in January.


# 43698 06-Feb-1999 dillon

Be nice when no swap is configured in system


# 43050 22-Jan-1999 dillon

Fix labeling bug


# 43047 22-Jan-1999 dillon

Make systat -swap use new kvm_swapinfo() function


# 40060 08-Oct-1998 obrien

Quiet many compiler warnings.


# 36789 09-Jun-1998 imp

o Use snprintf rather than sprintf
o Add more checks for buffer overflows
o Use snprintf rather than strcat/cpy and have better checks for max
length exceeded.

Most of these changes are not exploitable buffer overruns, but it never
hurts to be safe.

Inspired by and obtained from: OpenBSD


# 27232 06-Jul-1997 bde

Merge from Lite2 (print "??" instead NULL if devname() fails). More
faithful stealing from pstat would have given this already.


# 21617 12-Jan-1997 joerg

Fix the following old problem:

date: 1994/10/09 07:37:18; author: davidg; state: Exp; lines: +7 -1
#if 0'd out the meat of the swap code until I get a chance to rewrite it.

...mainly by stealing the code from pstat(8).


# 8874 30-May-1995 rgrimes

Remove trailing whitespace.


# 3452 09-Oct-1994 dg

#if 0'd out the meat of the swap code until I get a chance to rewrite it.


# 1591 27-May-1994 rgrimes

This commit was generated by cvs2svn to compensate for changes in r1590,
which included commits to RCS files with non-trunk default branches.


# 1590 27-May-1994 rgrimes

BSD 4.4 Lite Usr.bin Sources