Commit Graph

14 Commits

Author SHA1 Message Date
tmm
d6fecac748 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
2001-03-23 03:58:25 +00:00
rwatson
4853249b9b 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
2000-12-17 18:43:28 +00:00
rwatson
dd9a2cc445 o Make systat use sysctl() to retrieve hz and stathz, instead of
using kmem.
2000-11-25 03:46:45 +00:00
peter
3b842d34e8 $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
obrien
59bd962db0 Quiet many compiler warnings. 1998-10-08 09:56:10 +00:00
bde
cd1f335715 Fixed type mismatches which were fatal when sizeof(long) > sizeof(int). 1998-07-06 22:08:00 +00:00
imp
a51cfac665 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
1998-06-09 04:17:29 +00:00
charnier
287f219c02 Main() returns int. 1997-08-26 11:08:24 +00:00
charnier
d1a307d129 Use err(3). /sys/dkstat.h -> /usr/include/sys/dkstat.h 1997-08-13 06:45:11 +00:00
ache
61c0414a60 Localize time 1996-03-31 16:39:26 +00:00
phk
8fc888c0b8 Don't use curses until initialized. 1995-03-12 01:47:08 +00:00
bde
be27214244 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].
1994-12-03 10:06:40 +00:00
ache
d8ab8a9dd1 Prevents segm. fault on unknown option 1994-10-19 05:10:06 +00:00
rgrimes
f9ab90d9d6 BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00