Update to FreeBSD head 2018-02-01

Git mirror commit d079ae0442af8fa3cfd6d7ede190d04e64a2c0d4.

Update #3472.
This commit is contained in:
Sebastian Huber
2018-08-20 15:53:03 +02:00
parent bb80d9df8b
commit 18fa92c2dc
356 changed files with 6598 additions and 3376 deletions

View File

@@ -1,4 +1,6 @@
/*
/*-
* SPDX-License-Identifier: ISC
*
* Copyright (C) 2004, 2005, 2008 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1995-1999, 2001, 2003 Internet Software Consortium.
*

View File

@@ -1,4 +1,6 @@
/*
/*-
* SPDX-License-Identifier: ISC
*
* Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 1997,1999 by Internet Software Consortium.
*

View File

@@ -1,4 +1,6 @@
/*
/*-
* SPDX-License-Identifier: ISC
*
* Copyright (C) 2008 Internet Systems Consortium, Inc. ("ISC")
*
* Permission to use, copy, modify, and/or distribute this software for any

View File

@@ -67,7 +67,7 @@
* Implementation Details:
*
* The mutex primitives used by the library (mutex_t, mutex_lock, etc.)
* are macros which expand to the cooresponding primitives provided by
* are macros which expand to the corresponding primitives provided by
* the thread engine or to nothing. The latter is used so that code is
* not unreasonably cluttered with #ifdefs when all thread safe support
* is removed.

View File

@@ -1,7 +1,7 @@
#include <machine/rtems-bsd-user-space.h>
/*-
* SPDX-License-Identifier: BSD-3-Clause
* SPDX-License-Identifier: (BSD-3-Clause AND ISC)
*
* Copyright (c) 1983, 1990, 1993
* The Regents of the University of California. All rights reserved.

View File

@@ -1,6 +1,8 @@
#include <machine/rtems-bsd-user-space.h>
/*
/*-
* SPDX-License-Identifier: ISC
*
* Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 1998,1999 by Internet Software Consortium.
*

View File

@@ -1,6 +1,8 @@
#include <machine/rtems-bsd-user-space.h>
/*
/*-
* SPDX-License-Identifier: ISC
*
* Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 1998,1999 by Internet Software Consortium.
*

View File

@@ -1,6 +1,8 @@
#include <machine/rtems-bsd-user-space.h>
/*
/*-
* SPDX-License-Identifier: ISC
*
* Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 1996,1999 by Internet Software Consortium.
*

View File

@@ -1,6 +1,8 @@
#include <machine/rtems-bsd-user-space.h>
/*
/*-
* SPDX-License-Identifier: ISC
*
* Copyright (C) 2004, 2005, 2008 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1996, 1998, 1999, 2001, 2003 Internet Software Consortium.
*

View File

@@ -1,6 +1,8 @@
#include <machine/rtems-bsd-user-space.h>
/*
/*-
* SPDX-License-Identifier: ISC
*
* Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 1996,1999 by Internet Software Consortium.
*

View File

@@ -1,6 +1,8 @@
#include <machine/rtems-bsd-user-space.h>
/*
/*-
* SPDX-License-Identifier: ISC
*
* Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 1996-1999 by Internet Software Consortium.
*

View File

@@ -1,6 +1,8 @@
#include <machine/rtems-bsd-user-space.h>
/*
/*-
* SPDX-License-Identifier: ISC
*
* Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 1996,1999 by Internet Software Consortium.
*

View File

@@ -1,6 +1,8 @@
#include <machine/rtems-bsd-user-space.h>
/*
/*-
* SPDX-License-Identifier: ISC
*
* Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 1996-1999 by Internet Software Consortium.
*

View File

@@ -1,6 +1,8 @@
#include <machine/rtems-bsd-user-space.h>
/*
/*-
* SPDX-License-Identifier: ISC
*
* Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 1996-1999 by Internet Software Consortium
*

View File

@@ -1,6 +1,8 @@
#include <machine/rtems-bsd-user-space.h>
/*
/*-
* SPDX-License-Identifier: ISC
*
* Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 1995-1999 by Internet Software Consortium
*

View File

@@ -1,4 +1,6 @@
/*
/*-
* SPDX-License-Identifier: ISC
*
* Copyright (c) 2005 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 1995-1999 by Internet Software Consortium
*

View File

@@ -1,6 +1,8 @@
#include <machine/rtems-bsd-user-space.h>
/*
/*-
* SPDX-License-Identifier: ISC
*
* Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 1996,1999 by Internet Software Consortium.
*

View File

@@ -1,6 +1,8 @@
#include <machine/rtems-bsd-user-space.h>
/*
/*-
* SPDX-License-Identifier: ISC
*
* Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 1996,1999 by Internet Software Consortium.
*

View File

@@ -1,6 +1,8 @@
#include <machine/rtems-bsd-user-space.h>
/*
/*-
* SPDX-License-Identifier: ISC
*
* Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 1996,1999 by Internet Software Consortium.
*

View File

@@ -1,6 +1,8 @@
#include <machine/rtems-bsd-user-space.h>
/*
/*-
* SPDX-License-Identifier: ISC
*
* Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 1996-1999 by Internet Software Consortium.
*

View File

@@ -1,6 +1,8 @@
#include <machine/rtems-bsd-user-space.h>
/*
/*-
* SPDX-License-Identifier: ISC
*
* Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 1995,1999 by Internet Software Consortium.
*

View File

@@ -1,6 +1,8 @@
#include <machine/rtems-bsd-user-space.h>
/*
/*-
* SPDX-License-Identifier: ISC
*
* Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 1996,1999 by Internet Software Consortium.
*

View File

@@ -1279,7 +1279,8 @@ explore_numeric(const struct addrinfo *pai, const char *hostname,
* does not accept. So we need to separate the case for
* AF_INET.
*/
if (inet_aton(hostname, (struct in_addr *)pton) != 1)
if (inet_aton(hostname, (struct in_addr *)pton) != 1 ||
hostname[strspn(hostname, "0123456789.xabcdefXABCDEF")] != '\0')
return 0;
p = pton;
break;

View File

@@ -2,7 +2,9 @@
/* $KAME: getifaddrs.c,v 1.9 2001/08/20 02:31:20 itojun Exp $ */
/*
/*-
* SPDX-License-Identifier: BSD-1-Clause
*
* Copyright (c) 1995, 1999
* Berkeley Software Design, Inc. All rights reserved.
*

View File

@@ -3,6 +3,8 @@
/* $KAME: if_indextoname.c,v 1.7 2000/11/08 03:09:30 itojun Exp $ */
/*-
* SPDX-License-Identifier: BSD-1-Clause
*
* Copyright (c) 1997, 2000
* Berkeley Software Design, Inc. All rights reserved.
*

View File

@@ -3,6 +3,8 @@
/* $KAME: if_nameindex.c,v 1.8 2000/11/24 08:20:01 itojun Exp $ */
/*-
* SPDX-License-Identifier: BSD-1-Clause
*
* Copyright (c) 1997, 2000
* Berkeley Software Design, Inc. All rights reserved.
*

View File

@@ -3,6 +3,8 @@
/* $KAME: if_nametoindex.c,v 1.6 2000/11/24 08:18:54 itojun Exp $ */
/*-
* SPDX-License-Identifier: BSD-1-Clause
*
* Copyright (c) 1997, 2000
* Berkeley Software Design, Inc. All rights reserved.
*

View File

@@ -459,8 +459,8 @@ again:
first = 0;
if ((pwd = getpwnam(luser)) == NULL)
return (-1);
(void)strcpy(pbuf, pwd->pw_dir);
(void)strcat(pbuf, "/.rhosts");
(void)strlcpy(pbuf, pwd->pw_dir, sizeof(pbuf));
(void)strlcat(pbuf, "/.rhosts", sizeof(pbuf));
/*
* Change effective uid while opening .rhosts. If root and

View File

@@ -1,7 +1,7 @@
#include <machine/rtems-bsd-user-space.h>
/*-
* SPDX-License-Identifier: BSD-3-Clause
* SPDX-License-Identifier: (BSD-3-Clause AND ISC)
*
* Copyright (c) 1987, 1993
* The Regents of the University of California. All rights reserved.

View File

@@ -1,7 +1,7 @@
#include <machine/rtems-bsd-user-space.h>
/*-
* SPDX-License-Identifier: BSD-3-Clause
* SPDX-License-Identifier: (BSD-3-Clause AND ISC)
*
* Copyright (c) 1985, 1993
* The Regents of the University of California. All rights reserved.

View File

@@ -1,6 +1,8 @@
#include <machine/rtems-bsd-user-space.h>
/*
/*-
* SPDX-License-Identifier: ISC
*
* Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 1995-1999 by Internet Software Consortium.
*

View File

@@ -1,6 +1,8 @@
#include <machine/rtems-bsd-user-space.h>
/*
/*-
* SPDX-License-Identifier: (ISC AND BSD-3-Clause)
*
* Portions Copyright (C) 2004, 2005, 2008, 2009 Internet Systems Consortium, Inc. ("ISC")
* Portions Copyright (C) 1996-2003 Internet Software Consortium.
*
@@ -18,8 +20,6 @@
*/
/*-
* SPDX-License-Identifier: BSD-3-Clause
*
* Copyright (c) 1985
* The Regents of the University of California. All rights reserved.
*

View File

@@ -1,4 +1,6 @@
/*
/*-
* SPDX-License-Identifier: ISC
*
* Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 1999 by Internet Software Consortium.
*
@@ -13,6 +15,8 @@
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
* OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
* $FreeBSD$
*/
#ifndef _RES_DEBUG_H_

View File

@@ -4,7 +4,9 @@
static const char rcsid[] = "$Id: res_findzonecut.c,v 1.10 2005/10/11 00:10:16 marka Exp $";
#endif /* not lint */
/*
/*-
* SPDX-License-Identifier: ISC
*
* Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 1999 by Internet Software Consortium.
*

View File

@@ -1,7 +1,7 @@
#include <machine/rtems-bsd-user-space.h>
/*-
* SPDX-License-Identifier: BSD-3-Clause
* SPDX-License-Identifier: (BSD-3-Clause AND ISC)
*
* Copyright (c) 1985, 1989, 1993
* The Regents of the University of California. All rights reserved.

View File

@@ -1,6 +1,8 @@
#include <machine/rtems-bsd-user-space.h>
/*
/*-
* SPDX-License-Identifier: (ISC AND BSD-3-Clause)
*
* Portions Copyright (C) 2004, 2005, 2008 Internet Systems Consortium, Inc. ("ISC")
* Portions Copyright (C) 1996, 1997, 1988, 1999, 2001, 2003 Internet Software Consortium.
*
@@ -18,8 +20,6 @@
*/
/*-
* SPDX-License-Identifier: BSD-3-Clause
*
* Copyright (c) 1985, 1993
* The Regents of the University of California. All rights reserved.
*

View File

@@ -1,6 +1,8 @@
#include <machine/rtems-bsd-user-space.h>
/*
/*-
* SPDX-License-Identifier: ISC
*
* Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 1996-1999 by Internet Software Consortium.
*

View File

@@ -1,7 +1,7 @@
#include <machine/rtems-bsd-user-space.h>
/*-
* SPDX-License-Identifier: BSD-3-Clause
* SPDX-License-Identifier: (ISC AND BSD-3-Clause)
*
* Portions Copyright (C) 2004, 2005, 2008 Internet Systems Consortium, Inc. ("ISC")
* Portions Copyright (C) 1996-2001, 2003 Internet Software Consortium.

View File

@@ -1,7 +1,7 @@
#include <machine/rtems-bsd-user-space.h>
/*-
* SPDX-License-Identifier: BSD-3-Clause
* SPDX-License-Identifier: (ISC AND BSD-3-Clause)
*
* Portions Copyright (C) 2004-2009 Internet Systems Consortium, Inc. ("ISC")
* Portions Copyright (C) 1996-2003 Internet Software Consortium.

View File

@@ -4,7 +4,9 @@
static const char rcsid[] = "$Id: res_update.c,v 1.13 2005/04/27 04:56:43 sra Exp $";
#endif /* not lint */
/*
/*-
* SPDX-License-Identifier: ISC
*
* Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 1996-1999 by Internet Software Consortium.
*

View File

@@ -1,4 +1,6 @@
/*-
* SPDX-License-Identifier: BSD-2-Clause-FreeBSD
*
* Copyright (c) 2012-2013 The FreeBSD Foundation
* Copyright (c) 2015-2017 Mariusz Zaborski <oshogbo@FreeBSD.org>
* All rights reserved.
@@ -122,7 +124,15 @@ cap_wrap(int sock)
#ifdef WITH_CASPER
int cap_unwrap(cap_channel_t *chan);
#else
#define cap_unwrap(chan) (chan->cch_fd)
static inline int
cap_unwrap(cap_channel_t *chan)
{
int fd;
fd = chan->cch_fd;
free(chan);
return (fd);
}
#endif
/*
@@ -222,7 +232,7 @@ int cap_send_nvlist(const cap_channel_t *chan, const nvlist_t *nvl);
#ifdef WITH_CASPER
nvlist_t *cap_recv_nvlist(const cap_channel_t *chan, int flags);
#else
#define cap_recv_nvlist(chan, flags) (0)
#define cap_recv_nvlist(chan, flags) (nvlist_create(flags))
#endif
/*

View File

@@ -57,6 +57,8 @@ static struct nlist namelist[] = {
{ .n_name = "_mp_maxid" },
#define X_ALL_CPUS 2
{ .n_name = "_all_cpus" },
#define X_VM_NDOMAINS 3
{ .n_name = "_vm_ndomains" },
{ .n_name = "" },
};
@@ -300,11 +302,12 @@ memstat_kvm_uma(struct memory_type_list *list, void *kvm_handle)
{
LIST_HEAD(, uma_keg) uma_kegs;
struct memory_type *mtp;
struct uma_zone_domain uzd;
struct uma_bucket *ubp, ub;
struct uma_cache *ucp, *ucp_array;
struct uma_zone *uzp, uz;
struct uma_keg *kzp, kz;
int hint_dontsearch, i, mp_maxid, ret;
int hint_dontsearch, i, mp_maxid, ndomains, ret;
char name[MEMTYPE_MAXNAME];
cpuset_t all_cpus;
long cpusetsize;
@@ -326,6 +329,12 @@ memstat_kvm_uma(struct memory_type_list *list, void *kvm_handle)
list->mtl_error = ret;
return (-1);
}
ret = kread_symbol(kvm, X_VM_NDOMAINS, &ndomains,
sizeof(ndomains), 0);
if (ret != 0) {
list->mtl_error = ret;
return (-1);
}
ret = kread_symbol(kvm, X_UMA_KEGS, &uma_kegs, sizeof(uma_kegs), 0);
if (ret != 0) {
list->mtl_error = ret;
@@ -450,10 +459,17 @@ skip_percpu:
kz.uk_ipers;
mtp->mt_byteslimit = mtp->mt_countlimit * mtp->mt_size;
mtp->mt_count = mtp->mt_numallocs - mtp->mt_numfrees;
for (ubp = LIST_FIRST(&uz.uz_buckets); ubp !=
NULL; ubp = LIST_NEXT(&ub, ub_link)) {
ret = kread(kvm, ubp, &ub, sizeof(ub), 0);
mtp->mt_zonefree += ub.ub_cnt;
for (i = 0; i < ndomains; i++) {
ret = kread(kvm, &uz.uz_domain[i], &uzd,
sizeof(uzd), 0);
for (ubp =
LIST_FIRST(&uzd.uzd_buckets);
ubp != NULL;
ubp = LIST_NEXT(&ub, ub_link)) {
ret = kread(kvm, ubp, &ub,
sizeof(ub), 0);
mtp->mt_zonefree += ub.ub_cnt;
}
}
if (!((kz.uk_flags & UMA_ZONE_SECONDARY) &&
LIST_FIRST(&kz.uk_zones) != uzp)) {

View File

@@ -147,7 +147,8 @@ humanize_number(char *buf, size_t len, int64_t quotient,
*/
for (i = 0;
(quotient >= max || (quotient == max - 1 &&
remainder >= divisordeccut)) && i < maxscale; i++) {
(remainder >= divisordeccut || remainder >=
divisor / 2))) && i < maxscale; i++) {
remainder = quotient % divisor;
quotient /= divisor;
}