Commit Graph

15 Commits

Author SHA1 Message Date
Thomas Moestl
5a3c3d039a 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
2001-05-25 23:10:27 +00:00
Thomas Moestl
342e2faa09 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
Robert Watson
48c193e183 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
Robert Watson
7ace4e618a o Make systat use sysctl() to retrieve hz and stathz, instead of
using kmem.
2000-11-25 03:46:45 +00:00
Peter Wemm
c3aac50f28 $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
David E. O'Brien
d22889b821 Quiet many compiler warnings. 1998-10-08 09:56:10 +00:00
Bruce Evans
81a4459b5f Fixed type mismatches which were fatal when sizeof(long) > sizeof(int). 1998-07-06 22:08:00 +00:00
Warner Losh
448b84a0e4 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
Philippe Charnier
014927909d Main() returns int. 1997-08-26 11:08:24 +00:00
Philippe Charnier
d8793dfac3 Use err(3). /sys/dkstat.h -> /usr/include/sys/dkstat.h 1997-08-13 06:45:11 +00:00
Andrey A. Chernov
daab85586e Localize time 1996-03-31 16:39:26 +00:00
Poul-Henning Kamp
c3f4fea40c Don't use curses until initialized. 1995-03-12 01:47:08 +00:00
Bruce Evans
3544ae54e2 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
Andrey A. Chernov
dc5c110e4a Prevents segm. fault on unknown option 1994-10-19 05:10:06 +00:00
Rodney W. Grimes
9b50d90275 BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00