summaryrefslogtreecommitdiffstats
path: root/freebsd/usr.bin
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2018-08-09 14:02:09 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2018-09-21 10:29:38 +0200
commitbb80d9df8bac71eedee1a6787ca63aef972a7e48 (patch)
tree1b5cb9443c5ead5706c35afb618abbbd1592315e /freebsd/usr.bin
parentUpdate to FreeBSD head 2017-10-01 (diff)
downloadrtems-libbsd-bb80d9df8bac71eedee1a6787ca63aef972a7e48.tar.bz2
Update to FreeBSD head 2017-12-01
Git mirror commit e724f51f811a4b2bd29447f8b85ab5c2f9b88266. Update #3472.
Diffstat (limited to 'freebsd/usr.bin')
-rw-r--r--freebsd/usr.bin/netstat/bpf.c2
-rw-r--r--freebsd/usr.bin/netstat/if.c2
-rw-r--r--freebsd/usr.bin/netstat/inet.c3
-rw-r--r--freebsd/usr.bin/netstat/inet6.c2
-rw-r--r--freebsd/usr.bin/netstat/ipsec.c2
-rw-r--r--freebsd/usr.bin/netstat/main.c2
-rw-r--r--freebsd/usr.bin/netstat/mbuf.c2
-rw-r--r--freebsd/usr.bin/netstat/mroute.c2
-rw-r--r--freebsd/usr.bin/netstat/mroute6.c2
-rw-r--r--freebsd/usr.bin/netstat/netstat.h2
-rw-r--r--freebsd/usr.bin/netstat/pfkey.c2
-rw-r--r--freebsd/usr.bin/netstat/route.c2
-rw-r--r--freebsd/usr.bin/netstat/sctp.c2
-rw-r--r--freebsd/usr.bin/netstat/unix.c26
-rw-r--r--freebsd/usr.bin/vmstat/vmstat.c24
15 files changed, 51 insertions, 26 deletions
diff --git a/freebsd/usr.bin/netstat/bpf.c b/freebsd/usr.bin/netstat/bpf.c
index 6e7aad31..d5f06ffb 100644
--- a/freebsd/usr.bin/netstat/bpf.c
+++ b/freebsd/usr.bin/netstat/bpf.c
@@ -5,6 +5,8 @@
#endif /* __rtems__ */
/*-
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
* Copyright (c) 2005 Christian S.J. Peron
* All rights reserved.
*
diff --git a/freebsd/usr.bin/netstat/if.c b/freebsd/usr.bin/netstat/if.c
index 210660bc..c578629e 100644
--- a/freebsd/usr.bin/netstat/if.c
+++ b/freebsd/usr.bin/netstat/if.c
@@ -5,6 +5,8 @@
#endif /* __rtems__ */
/*-
+ * SPDX-License-Identifier: BSD-3-Clause
+ *
* Copyright (c) 2013 Gleb Smirnoff <glebius@FreeBSD.org>
* Copyright (c) 1983, 1988, 1993
* The Regents of the University of California. All rights reserved.
diff --git a/freebsd/usr.bin/netstat/inet.c b/freebsd/usr.bin/netstat/inet.c
index 1b1bb2cb..681fef92 100644
--- a/freebsd/usr.bin/netstat/inet.c
+++ b/freebsd/usr.bin/netstat/inet.c
@@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$");
#include <sys/domain.h>
#include <sys/protosw.h>
#include <sys/socket.h>
+#define _WANT_SOCKET
#include <sys/socketvar.h>
#include <sys/sysctl.h>
@@ -184,7 +185,7 @@ sotoxsocket(struct socket *so, struct xsocket *xso)
xso->xso_family = domain.dom_family;
xso->so_timeo = so->so_timeo;
xso->so_error = so->so_error;
- if (SOLISTENING(so)) {
+ if ((so->so_options & SO_ACCEPTCONN) != 0) {
xso->so_qlen = so->sol_qlen;
xso->so_incqlen = so->sol_incqlen;
xso->so_qlimit = so->sol_qlimit;
diff --git a/freebsd/usr.bin/netstat/inet6.c b/freebsd/usr.bin/netstat/inet6.c
index 9d45cde6..9954a89f 100644
--- a/freebsd/usr.bin/netstat/inet6.c
+++ b/freebsd/usr.bin/netstat/inet6.c
@@ -6,6 +6,8 @@
/* BSDI inet.c,v 2.3 1995/10/24 02:19:29 prb Exp */
/*-
+ * SPDX-License-Identifier: BSD-3-Clause
+ *
* Copyright (c) 1983, 1988, 1993
* The Regents of the University of California. All rights reserved.
*
diff --git a/freebsd/usr.bin/netstat/ipsec.c b/freebsd/usr.bin/netstat/ipsec.c
index 94763c08..ba0fb483 100644
--- a/freebsd/usr.bin/netstat/ipsec.c
+++ b/freebsd/usr.bin/netstat/ipsec.c
@@ -7,6 +7,8 @@
/* $KAME: ipsec.c,v 1.33 2003/07/25 09:54:32 itojun Exp $ */
/*-
+ * SPDX-License-Identifier: BSD-3-Clause
+ *
* Copyright (c) 2005 NTT Multimedia Communications Laboratories, Inc.
* All rights reserved.
*
diff --git a/freebsd/usr.bin/netstat/main.c b/freebsd/usr.bin/netstat/main.c
index 0e51ddc3..067384b4 100644
--- a/freebsd/usr.bin/netstat/main.c
+++ b/freebsd/usr.bin/netstat/main.c
@@ -5,6 +5,8 @@
#endif /* __rtems__ */
/*-
+ * SPDX-License-Identifier: BSD-3-Clause
+ *
* Copyright (c) 1983, 1988, 1993
* Regents of the University of California. All rights reserved.
*
diff --git a/freebsd/usr.bin/netstat/mbuf.c b/freebsd/usr.bin/netstat/mbuf.c
index 355be1a6..4dfd70a2 100644
--- a/freebsd/usr.bin/netstat/mbuf.c
+++ b/freebsd/usr.bin/netstat/mbuf.c
@@ -5,6 +5,8 @@
#endif /* __rtems__ */
/*-
+ * SPDX-License-Identifier: BSD-4-Clause
+ *
* Copyright (c) 1983, 1988, 1993
* The Regents of the University of California.
* Copyright (c) 2005 Robert N. M. Watson
diff --git a/freebsd/usr.bin/netstat/mroute.c b/freebsd/usr.bin/netstat/mroute.c
index e6143204..f2937e30 100644
--- a/freebsd/usr.bin/netstat/mroute.c
+++ b/freebsd/usr.bin/netstat/mroute.c
@@ -5,6 +5,8 @@
#endif /* __rtems__ */
/*-
+ * SPDX-License-Identifier: BSD-4-Clause
+ *
* Copyright (c) 1989 Stephen Deering
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
diff --git a/freebsd/usr.bin/netstat/mroute6.c b/freebsd/usr.bin/netstat/mroute6.c
index c4a87de1..f2849941 100644
--- a/freebsd/usr.bin/netstat/mroute6.c
+++ b/freebsd/usr.bin/netstat/mroute6.c
@@ -5,6 +5,8 @@
#endif /* __rtems__ */
/*-
+ * SPDX-License-Identifier: BSD-4-Clause AND BSD-3-Clause
+ *
* Copyright (C) 1998 WIDE Project.
* All rights reserved.
*
diff --git a/freebsd/usr.bin/netstat/netstat.h b/freebsd/usr.bin/netstat/netstat.h
index d6402987..0d9e027e 100644
--- a/freebsd/usr.bin/netstat/netstat.h
+++ b/freebsd/usr.bin/netstat/netstat.h
@@ -1,4 +1,6 @@
/*-
+ * SPDX-License-Identifier: BSD-3-Clause
+ *
* Copyright (c) 1992, 1993
* Regents of the University of California. All rights reserved.
*
diff --git a/freebsd/usr.bin/netstat/pfkey.c b/freebsd/usr.bin/netstat/pfkey.c
index ba54a30c..7c234dbe 100644
--- a/freebsd/usr.bin/netstat/pfkey.c
+++ b/freebsd/usr.bin/netstat/pfkey.c
@@ -7,6 +7,8 @@
/* $NetBSD: inet.c,v 1.35.2.1 1999/04/29 14:57:08 perry Exp $ */
/* $KAME: ipsec.c,v 1.25 2001/03/12 09:04:39 itojun Exp $ */
/*-
+ * SPDX-License-Identifier: BSD-3-Clause
+ *
* Copyright (C) 1995, 1996, 1997, 1998, and 1999 WIDE Project.
* All rights reserved.
*
diff --git a/freebsd/usr.bin/netstat/route.c b/freebsd/usr.bin/netstat/route.c
index 2a99ad76..2e4682e4 100644
--- a/freebsd/usr.bin/netstat/route.c
+++ b/freebsd/usr.bin/netstat/route.c
@@ -5,6 +5,8 @@
#endif /* __rtems__ */
/*-
+ * SPDX-License-Identifier: BSD-3-Clause
+ *
* Copyright (c) 1983, 1988, 1993
* The Regents of the University of California. All rights reserved.
*
diff --git a/freebsd/usr.bin/netstat/sctp.c b/freebsd/usr.bin/netstat/sctp.c
index dc4be803..a2ef4767 100644
--- a/freebsd/usr.bin/netstat/sctp.c
+++ b/freebsd/usr.bin/netstat/sctp.c
@@ -5,6 +5,8 @@
#endif /* __rtems__ */
/*-
+ * SPDX-License-Identifier: BSD-3-Clause
+ *
* Copyright (c) 2001-2007, by Weongyo Jeong. All rights reserved.
* Copyright (c) 2011, by Michael Tuexen. All rights reserved.
*
diff --git a/freebsd/usr.bin/netstat/unix.c b/freebsd/usr.bin/netstat/unix.c
index 42093c25..bca42672 100644
--- a/freebsd/usr.bin/netstat/unix.c
+++ b/freebsd/usr.bin/netstat/unix.c
@@ -5,6 +5,8 @@
#endif /* __rtems__ */
/*-
+ * SPDX-License-Identifier: BSD-3-Clause
+ *
* Copyright (c) 1983, 1988, 1993
* The Regents of the University of California. All rights reserved.
*
@@ -52,10 +54,12 @@ __FBSDID("$FreeBSD$");
#include <sys/queue.h>
#include <sys/protosw.h>
#include <sys/socket.h>
+#define _WANT_SOCKET
#include <sys/socketvar.h>
#include <sys/mbuf.h>
#include <sys/sysctl.h>
#include <sys/un.h>
+#define _WANT_UNPCB
#include <sys/unpcb.h>
#include <netinet/in.h>
@@ -113,7 +117,7 @@ static int
pcblist_kvm(u_long count_off, u_long gencnt_off, u_long head_off, char **bufp)
{
struct unp_head head;
- struct unpcb *unp, unp_conn;
+ struct unpcb *unp, unp0, unp_conn;
u_char sun_len;
struct socket so;
struct xunpgen xug;
@@ -163,8 +167,8 @@ pcblist_kvm(u_long count_off, u_long gencnt_off, u_long head_off, char **bufp)
KREAD(head_off, &head, sizeof(head));
LIST_FOREACH(unp, &head, unp_link) {
xu.xu_unpp = unp;
- KREAD(unp, &xu.xu_unp, sizeof (*unp));
- unp = &xu.xu_unp;
+ KREAD(unp, &unp0, sizeof (*unp));
+ unp = &unp0;
if (unp->unp_gencnt > unp_gencnt)
continue;
@@ -251,7 +255,7 @@ unixpr(u_long count_off, u_long gencnt_off, u_long dhead_off, u_long shead_off,
so = &xunp->xu_socket;
/* Ignore PCBs which were freed during copyout. */
- if (xunp->xu_unp.unp_gencnt > oxug->xug_gen)
+ if (xunp->unp_gencnt > oxug->xug_gen)
continue;
if (*first) {
xo_open_list("socket");
@@ -285,7 +289,6 @@ unixpr(u_long count_off, u_long gencnt_off, u_long dhead_off, u_long shead_off,
static void
unixdomainpr(struct xunpcb *xunp, struct xsocket *so)
{
- struct unpcb *unp;
struct sockaddr_un *sa;
static int first = 1;
char buf1[33];
@@ -309,11 +312,7 @@ unixdomainpr(struct xunpcb *xunp, struct xsocket *so)
};
int fmt = (sizeof(void *) == 8) ? 1 : 0;
- unp = &xunp->xu_unp;
- if (unp->unp_addr)
- sa = &xunp->xu_addr;
- else
- sa = (struct sockaddr_un *)0;
+ sa = (xunp->xu_addr.sun_family == AF_UNIX) ? &xunp->xu_addr : NULL;
if (first && !Lflag) {
xo_emit("{T:Active UNIX domain sockets}\n");
@@ -335,10 +334,9 @@ unixdomainpr(struct xunpcb *xunp, struct xsocket *so)
} else {
xo_emit(format[fmt],
(long)so->so_pcb, socktype[so->so_type], so->so_rcv.sb_cc,
- so->so_snd.sb_cc, (long)unp->unp_vnode,
- (long)unp->unp_conn,
- (long)LIST_FIRST(&unp->unp_refs),
- (long)LIST_NEXT(unp, unp_reflink));
+ so->so_snd.sb_cc, (long)xunp->unp_vnode,
+ (long)xunp->unp_conn, (long)xunp->xu_firstref,
+ (long)xunp->xu_nextref);
}
if (sa)
xo_emit(" {:path/%.*s}",
diff --git a/freebsd/usr.bin/vmstat/vmstat.c b/freebsd/usr.bin/vmstat/vmstat.c
index 7c54ba8d..bd4997d6 100644
--- a/freebsd/usr.bin/vmstat/vmstat.c
+++ b/freebsd/usr.bin/vmstat/vmstat.c
@@ -1,6 +1,8 @@
#include <machine/rtems-bsd-user-space.h>
-/*
+/*-
+ * SPDX-License-Identifier: BSD-3-Clause
+ *
* Copyright (c) 1980, 1986, 1991, 1993
* The Regents of the University of California. All rights reserved.
*
@@ -719,7 +721,7 @@ getcpuinfo(u_long *maskp, int *maxidp)
static void
-prthuman(const char *name, u_int64_t val, int size)
+prthuman(const char *name, uint64_t val, int size)
{
char buf[10];
int flags;
@@ -871,22 +873,22 @@ dovmstat(unsigned int interval, int reps)
total.t_rq - 1, total.t_dw + total.t_pw, total.t_sw);
xo_close_container("processes");
xo_open_container("memory");
-#define vmstat_pgtok(a) ((a) * (sum.v_page_size >> 10))
+#define vmstat_pgtok(a) ((uintmax_t)(a) * (sum.v_page_size >> 10))
#define rate(x) (((x) * rate_adj + halfuptime) / uptime) /* round */
if (hflag) {
xo_emit("");
prthuman("available-memory",
- total.t_avm * (u_int64_t)sum.v_page_size, 5);
+ total.t_avm * (uint64_t)sum.v_page_size, 5);
xo_emit(" ");
prthuman("free-memory",
- total.t_free * (u_int64_t)sum.v_page_size, 5);
+ total.t_free * (uint64_t)sum.v_page_size, 5);
xo_emit(" ");
} else {
xo_emit(" ");
- xo_emit("{:available-memory/%7d}",
+ xo_emit("{:available-memory/%7ju}",
vmstat_pgtok(total.t_avm));
xo_emit(" ");
- xo_emit("{:free-memory/%7d}",
+ xo_emit("{:free-memory/%7ju}",
vmstat_pgtok(total.t_free));
xo_emit(" ");
}
@@ -1115,7 +1117,7 @@ dosum(void)
sum.v_vnodepgsin);
xo_emit("{:vnode-page-outs/%9u} {N:vnode pager pageouts}\n",
sum.v_vnodeout);
- xo_emit("{:vnode-page-outs/%9u} {N:vnode pager pages paged out}\n",
+ xo_emit("{:vnode-page-out-pages/%9u} {N:vnode pager pages paged out}\n",
sum.v_vnodepgsout);
xo_emit("{:page-daemon-wakeups/%9u} {N:page daemon wakeups}\n",
sum.v_pdwakeups);
@@ -1618,9 +1620,9 @@ display_object(struct kinfo_vmobject *kvo)
const char *str;
xo_open_instance("object");
- xo_emit("{:resident/%5jd} ", (uintmax_t)kvo->kvo_resident);
- xo_emit("{:active/%5jd} ", (uintmax_t)kvo->kvo_active);
- xo_emit("{:inactive/%5jd} ", (uintmax_t)kvo->kvo_inactive);
+ xo_emit("{:resident/%5ju} ", (uintmax_t)kvo->kvo_resident);
+ xo_emit("{:active/%5ju} ", (uintmax_t)kvo->kvo_active);
+ xo_emit("{:inactive/%5ju} ", (uintmax_t)kvo->kvo_inactive);
xo_emit("{:refcount/%3d} ", kvo->kvo_ref_count);
xo_emit("{:shadowcount/%3d} ", kvo->kvo_shadow_count);
switch (kvo->kvo_memattr) {