Deleted Added
full compact
main.c (261601) main.c (262763)
1/*-
2 * Copyright (c) 1983, 1988, 1993
3 * Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 26 unchanged lines hidden (view full) ---

35
36#if 0
37#ifndef lint
38static char sccsid[] = "@(#)main.c 8.4 (Berkeley) 3/1/94";
39#endif /* not lint */
40#endif
41
42#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 1983, 1988, 1993
3 * Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 26 unchanged lines hidden (view full) ---

35
36#if 0
37#ifndef lint
38static char sccsid[] = "@(#)main.c 8.4 (Berkeley) 3/1/94";
39#endif /* not lint */
40#endif
41
42#include <sys/cdefs.h>
43__FBSDID("$FreeBSD: head/usr.bin/netstat/main.c 261601 2014-02-07 15:18:23Z glebius $");
43__FBSDID("$FreeBSD: head/usr.bin/netstat/main.c 262763 2014-03-05 01:17:47Z glebius $");
44
45#include <sys/param.h>
46#include <sys/file.h>
47#include <sys/protosw.h>
48#include <sys/socket.h>
49#include <sys/socketvar.h>
50
51#include <netinet/in.h>

--- 706 unchanged lines hidden (view full) ---

758 if (kvm_read(kvmd, addr, buf, size) != (ssize_t)size) {
759 warnx("%s", kvm_geterr(kvmd));
760 return (-1);
761 }
762 return (0);
763}
764
765/*
44
45#include <sys/param.h>
46#include <sys/file.h>
47#include <sys/protosw.h>
48#include <sys/socket.h>
49#include <sys/socketvar.h>
50
51#include <netinet/in.h>

--- 706 unchanged lines hidden (view full) ---

758 if (kvm_read(kvmd, addr, buf, size) != (ssize_t)size) {
759 warnx("%s", kvm_geterr(kvmd));
760 return (-1);
761 }
762 return (0);
763}
764
765/*
766 * Read single counter(9).
767 */
768uint64_t
769kread_counter(u_long addr)
770{
771
772 if (kvmd_init() < 0)
773 return (-1);
774
775 return (kvm_counter_u64_fetch(kvmd, addr));
776}
777
778/*
766 * Read an array of N counters in kernel memory into array of N uint64_t's.
767 */
768int
769kread_counters(u_long addr, void *buf, size_t size)
770{
771 uint64_t *c = buf;
772
773 if (kvmd_init() < 0)

--- 98 unchanged lines hidden ---
779 * Read an array of N counters in kernel memory into array of N uint64_t's.
780 */
781int
782kread_counters(u_long addr, void *buf, size_t size)
783{
784 uint64_t *c = buf;
785
786 if (kvmd_init() < 0)

--- 98 unchanged lines hidden ---