-/* $OpenBSD: cpu.c,v 1.3 2014/09/15 19:08:21 miod Exp $ */
+/* $OpenBSD: cpu.c,v 1.4 2015/01/16 00:03:37 deraadt Exp $ */
/*
* Copyright (c) 2013 Reyk Floeter <reyk@openbsd.org>
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <sys/param.h>
+#include <sys/signal.h>
#include <sys/sched.h>
#include <sys/sysctl.h>
-/* $OpenBSD: if.c,v 1.22 2014/10/08 04:10:04 doug Exp $ */
+/* $OpenBSD: if.c,v 1.23 2015/01/16 00:03:37 deraadt Exp $ */
/*
* Copyright (c) 2004 Markus Friedl <markus@openbsd.org>
*
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#include <sys/param.h>
-#include <sys/types.h>
+#include <sys/param.h> /* roundup */
+#include <sys/signal.h>
#include <sys/socket.h>
#include <sys/sysctl.h>
#include <net/if.h>
-/* $OpenBSD: inetname.c,v 1.1 2010/07/22 12:33:29 giovanni Exp $ */
+/* $OpenBSD: inetname.c,v 1.2 2015/01/16 00:03:37 deraadt Exp $ */
/*-
* Copyright (c) 1980, 1992, 1993
* SUCH DAMAGE.
*/
-#include <sys/param.h>
+#include <sys/signal.h>
#include <sys/socket.h>
#include <netinet/in.h>
-/* $OpenBSD: iostat.c,v 1.44 2014/11/23 04:34:48 guenther Exp $ */
+/* $OpenBSD: iostat.c,v 1.45 2015/01/16 00:03:37 deraadt Exp $ */
/* $NetBSD: iostat.c,v 1.5 1996/05/10 23:16:35 thorpej Exp $ */
/*
* SUCH DAMAGE.
*/
-#include <sys/param.h>
+#include <sys/types.h>
#include <sys/mount.h>
+#include <sys/signal.h>
#include <sys/sched.h>
#include <sys/sysctl.h>
#include <sys/time.h>
-/* $Id: main.c,v 1.60 2013/09/07 11:43:50 reyk Exp $ */
+/* $Id: main.c,v 1.61 2015/01/16 00:03:37 deraadt Exp $ */
/*
* Copyright (c) 2001, 2007 Can Erkin Acar
* Copyright (c) 2001 Daniel Hartmeier
*/
#include <sys/types.h>
-#include <sys/param.h>
#include <sys/sysctl.h>
int verbose = 1; /* to report kvm read errs */
int nflag = 1;
int ut, hz, stathz;
-char hostname[MAXHOSTNAMELEN];
+char hostname[HOST_NAME_MAX+1];
WINDOW *wnd;
int CMDLINE;
char timebuf[26];
-/* $OpenBSD: malloc.c,v 1.2 2011/03/02 06:48:17 jasper Exp $ */
+/* $OpenBSD: malloc.c,v 1.3 2015/01/16 00:03:37 deraadt Exp $ */
/*
* Copyright (c) 2008 Can Erkin Acar <canacar@openbsd.org>
*
*/
#include <sys/types.h>
-#include <sys/param.h>
+#include <sys/signal.h>
#include <sys/sysctl.h>
#include <sys/malloc.h>
#include <errno.h>
#include <stdlib.h>
#include <string.h>
+#include <limits.h>
#include "systat.h"
-/* $OpenBSD: mbufs.c,v 1.37 2014/11/06 12:50:55 dlg Exp $ */
+/* $OpenBSD: mbufs.c,v 1.38 2015/01/16 00:03:37 deraadt Exp $ */
/*
* Copyright (c) 2008 Can Erkin Acar <canacar@openbsd.org>
*
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#include <sys/param.h>
-#include <sys/types.h>
+
+#include <sys/param.h> /* MSIZE */
+#include <sys/signal.h>
#include <sys/socket.h>
#include <sys/sysctl.h>
#include <sys/mbuf.h>
-/* $OpenBSD: netstat.c,v 1.42 2014/10/24 10:18:49 schwarze Exp $ */
+/* $OpenBSD: netstat.c,v 1.43 2015/01/16 00:03:37 deraadt Exp $ */
/* $NetBSD: netstat.c,v 1.3 1995/06/18 23:53:07 cgd Exp $ */
/*-
/*
* netstat
*/
-#include <sys/param.h>
+
+#include <sys/param.h> /* MSIZE */
+#include <sys/signal.h>
#include <sys/socket.h>
#include <sys/socketvar.h>
#include <sys/mbuf.h>
-/* $OpenBSD: nfs.c,v 1.6 2011/03/02 06:48:17 jasper Exp $ */
+/* $OpenBSD: nfs.c,v 1.7 2015/01/16 00:03:37 deraadt Exp $ */
/*
* Copyright (c) 2009 Jasper Lievisse Adriaanse <jasper@openbsd.org>
*
*/
-#include <sys/param.h>
+#include <sys/types.h>
#include <sys/mount.h>
+#include <sys/signal.h>
#include <sys/sysctl.h>
#include <sys/types.h>
#include <nfs/rpcv2.h>
-/* $OpenBSD: pf.c,v 1.6 2014/08/14 12:55:50 mpi Exp $ */
+/* $OpenBSD: pf.c,v 1.7 2015/01/16 00:03:37 deraadt Exp $ */
/*
* Copyright (c) 2001, 2007 Can Erkin Acar <canacar@openbsd.org>
*
#include <sys/types.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
+#include <sys/signal.h>
#include <net/if.h>
#include <netinet/in.h>
#include <netinet/ip.h>
-/* $OpenBSD: pftop.c,v 1.29 2014/10/11 04:30:56 doug Exp $ */
+/* $OpenBSD: pftop.c,v 1.30 2015/01/16 00:03:37 deraadt Exp $ */
/*
* Copyright (c) 2001, 2007 Can Erkin Acar
* Copyright (c) 2001 Daniel Hartmeier
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
+#include <limits.h>
#include <stdarg.h>
#include "systat.h"
}
struct anchor_name {
- char name[MAXPATHLEN];
+ char name[PATH_MAX];
struct anchor_name *next;
u_int32_t ref;
};
-/* $OpenBSD: pigs.c,v 1.28 2014/10/08 04:10:04 doug Exp $ */
+/* $OpenBSD: pigs.c,v 1.29 2015/01/16 00:03:37 deraadt Exp $ */
/* $NetBSD: pigs.c,v 1.3 1995/04/29 05:54:50 cgd Exp $ */
/*-
* Pigs display from Bill Reeves at Lucasfilm
*/
-#include <sys/param.h>
+#include <sys/param.h> /* MAXCOMLEN */
+#include <sys/signal.h>
#include <sys/proc.h>
#include <sys/resource.h>
#include <sys/sched.h>
-/* $OpenBSD: pool.c,v 1.9 2014/10/08 04:10:04 doug Exp $ */
+/* $OpenBSD: pool.c,v 1.10 2015/01/16 00:03:37 deraadt Exp $ */
/*
* Copyright (c) 2008 Can Erkin Acar <canacar@openbsd.org>
*
*/
#include <sys/types.h>
-#include <sys/param.h>
+#include <sys/signal.h>
#include <sys/sysctl.h>
#include <sys/pool.h>
#include <errno.h>
#include <stdlib.h>
#include <string.h>
+#include <limits.h>
#include "systat.h"
-/* $OpenBSD: sensors.c,v 1.29 2014/10/08 04:10:04 doug Exp $ */
+/* $OpenBSD: sensors.c,v 1.30 2015/01/16 00:03:38 deraadt Exp $ */
/*
* Copyright (c) 2007 Deanna Phillips <deanna@openbsd.org>
*
*/
-#include <sys/param.h>
+#include <sys/types.h>
+#include <sys/signal.h>
#include <sys/sysctl.h>
#include <sys/sensors.h>
-/* $OpenBSD: swap.c,v 1.25 2014/11/23 04:34:48 guenther Exp $ */
+/* $OpenBSD: swap.c,v 1.26 2015/01/16 00:03:38 deraadt Exp $ */
/* $NetBSD: swap.c,v 1.9 1998/12/26 07:05:08 marc Exp $ */
/*-
* SUCH DAMAGE.
*/
-#include <sys/param.h>
+#include <sys/types.h>
+#include <sys/signal.h>
#include <sys/conf.h>
#include <sys/ioctl.h>
#include <sys/stat.h>
-/* $OpenBSD: vmstat.c,v 1.78 2014/11/23 04:34:48 guenther Exp $ */
+/* $OpenBSD: vmstat.c,v 1.79 2015/01/16 00:03:38 deraadt Exp $ */
/* $NetBSD: vmstat.c,v 1.5 1996/05/10 23:16:40 thorpej Exp $ */
/*-
* Cursed vmstat -- from Robert Elz.
*/
-#include <sys/param.h>
+#include <sys/param.h> /* MAXCOMLEN */
+#include <sys/types.h>
#include <sys/namei.h>
#include <sys/proc.h>
#include <sys/sched.h>
#include <unistd.h>
#include "systat.h"
+#include "dkstats.h"
+
+#define MAXIMUM(a, b) (((a) > (b)) ? (a) : (b))
static struct Info {
long time[CPUSTATES];
u_quad_t *intrcnt;
} s, s1, s2, s3, z;
-#include "dkstats.h"
extern struct _disk cur;
#define cnt s.Cnt
mvprintw(DISKROW + 4, DISKCOL, " sec");
for (i = 0, j = 0; i < cur.dk_ndrive && j < DRIVESPACE; i++)
if (cur.dk_select[i] && (j + strlen(dr_name[i])) < DRIVESPACE) {
- l = MAX(5, strlen(dr_name[i]));
+ l = MAXIMUM(5, strlen(dr_name[i]));
mvprintw(DISKROW, DISKCOL + 5 + j,
" %*s", l, dr_name[i]);
j += 1 + l;
mvprintw(DISKROW, DISKCOL + 5, " ");
for (i = 0, c = 0; i < cur.dk_ndrive && c < DRIVESPACE; i++)
if (cur.dk_select[i] && (c + strlen(dr_name[i])) < DRIVESPACE) {
- l = MAX(5, strlen(dr_name[i]));
+ l = MAXIMUM(5, strlen(dr_name[i]));
mvprintw(DISKROW, DISKCOL + 5 + c,
" %*s", l, dr_name[i]);
c += 1 + l;