History log of /freebsd-10.1-release/usr.bin/systat/main.c
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 272461 02-Oct-2014 gjb

Copy stable/10@r272459 to releng/10.1 as part of
the 10.1-RELEASE process.

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

# 262643 01-Mar-2014 brooks

MFC r261296:

Merge from CheriBSD:
commit c1acf022c533c5ae27e0cd556977eafe3f5959eb
Author: Brooks Davis <brooks@one-eyed-alien.net>
Date: Fri Jan 17 21:46:44 2014 +0000

Add an option WITHOUT_NCURSESW to suppress building and linking to
libncursesw. While wide character support it useful we'd like to
only need one ncurses library on embedded systems.

Sponsored by: DARPA, AFRL


# 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


# 246987 19-Feb-2013 charnier

Remove old-style function definition


# 240605 17-Sep-2012 melifaro

Make systat(1) accept fractional number of seconds.
Make old alarm(3)-based code use select(2).

MFC after: 2 weeks


# 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


# 199242 13-Nov-2009 ume

Use ncursesw to output the date field of vmstat display
with multi-byte string, correctly.


# 197956 11-Oct-2009 jh

- Catch SIGHUP to perform cleanup before exiting.
- Exit if getch() returns with an error other than EINTR. Otherwise
systat(1) may get stuck in an infinite loop if it doesn't receive
SIGHUP when terminal closes. [1]
- Remove attempt to clear stdio error indicators. getch() doesn't use
stdio, making it useless. [2]
- Remove unneeded masking of getch() return value. [2]

PR: bin/107171
Reviewed by: bde
Approved by: trasz (mentor)
Obtained from: OpenBSD [1]
Suggested by: bde [2]
MFC after: 1 month


# 175387 16-Jan-2008 delphij

ANSIfy and remove register.

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


# 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


# 126775 09-Mar-2004 dwmalone

Fix the easy warnings:

1) Avoid shadowing index.
2) Constness.
3) Missing prototype for ifcmd.
4) Missing include of string.h.
5) Avoid shadowing error function.
6) ANSI definition for main.


# 93058 23-Mar-2002 imp

unifdef __STDC__


# 87715 11-Dec-2001 markm

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


# 77205 25-May-2001 tmm

Fix the error buffer passed to kvm_openfiles to have a length of
_POSIX2_LINE_MAX as required.
While being there, wrap an overly long line.

MFC after: 3 days


# 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


# 70118 17-Dec-2000 rwatson

o Fix up includes which built due to excessive nested including in the
base system, but not in BruceBSD.
o Fix up style violations of various sorts.
o Remove redundant normalization of hertz variable, as the sysctl handler
does this work (unlike when kread was used).

Submitted by: bde


# 69140 25-Nov-2000 rwatson

o Make systat use sysctl() to retrieve hz and stathz, instead of
using kmem.


# 50477 27-Aug-1999 peter

$Id$ -> $FreeBSD$


# 40060 08-Oct-1998 obrien

Quiet many compiler warnings.


# 37455 06-Jul-1998 bde

Fixed type mismatches which were fatal when sizeof(long) > sizeof(int).


# 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


# 28789 26-Aug-1997 charnier

Main() returns int.


# 28149 13-Aug-1997 charnier

Use err(3). /sys/dkstat.h -> /usr/include/sys/dkstat.h


# 14953 31-Mar-1996 ache

Localize time


# 7011 11-Mar-1995 phk

Don't use curses until initialized.


# 4930 03-Dec-1994 bde

extern.h, iostat.c, main.c, vmstat.c:
Use the correct value of hz (stathz if it is nonzero) for
interpretion of dk_time[] and cp_time[] in iostat.c. Avoid
multiple conversions of this value in iostat.c and vmstat.c

iostat.c:
Implement the display of cp_time[CP_INTR]. Fix the display
of cp_time[CP_IDLE] (the display was always null because
cp_time[CP_INTR] == 0 was displayed instead).

systat.1:
Document the display of cp_time[CP_INTR].

vmstat.c:
Implement the display of cp_time[CP_INTR].


# 3717 19-Oct-1994 ache

Prevents segm. fault on unknown option


# 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