Libraries updates and cleanup
* Updating common/lib * Updating lib/csu * Updating lib/libc * Updating libexec/ld.elf_so * Corrected test on __minix in featuretest to actually follow the meaning of the comment. * Cleaned up _REENTRANT-related defintions. * Disabled -D_REENTRANT for libfetch * Removing some unneeded __NBSD_LIBC defines and tests Change-Id: Ic1394baef74d11b9f86b312f5ff4bbc3cbf72ce2
This commit is contained in:
+13
-15
@@ -1,4 +1,4 @@
|
||||
/* $NetBSD: sysctl.c,v 1.30 2008/08/27 08:56:49 christos Exp $ */
|
||||
/* $NetBSD: sysctl.c,v 1.32 2012/03/20 16:36:05 matt Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1993
|
||||
@@ -34,7 +34,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)sysctl.c 8.2 (Berkeley) 1/4/94";
|
||||
#else
|
||||
__RCSID("$NetBSD: sysctl.c,v 1.30 2008/08/27 08:56:49 christos Exp $");
|
||||
__RCSID("$NetBSD: sysctl.c,v 1.32 2012/03/20 16:36:05 matt Exp $");
|
||||
#endif
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
@@ -43,6 +43,7 @@ __RCSID("$NetBSD: sysctl.c,v 1.30 2008/08/27 08:56:49 christos Exp $");
|
||||
#define __COMPAT_SYSCTL
|
||||
#include <sys/sysctl.h>
|
||||
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
#include <paths.h>
|
||||
#include <stdio.h>
|
||||
@@ -69,12 +70,9 @@ static size_t __cvt_node_out(uint, const struct sysctlnode *, void **,
|
||||
#include <stdlib.h>
|
||||
|
||||
int
|
||||
sysctl(name, namelen, oldp, oldlenp, newp, newlen)
|
||||
const int *name;
|
||||
unsigned int namelen;
|
||||
void *oldp;
|
||||
const void *newp;
|
||||
size_t *oldlenp, newlen;
|
||||
sysctl(const int *name, unsigned int namelen,
|
||||
void *oldp, size_t *oldlenp,
|
||||
const void *newp, size_t newlen)
|
||||
{
|
||||
size_t oldlen, savelen;
|
||||
int error;
|
||||
@@ -104,12 +102,9 @@ sysctl(name, namelen, oldp, oldlenp, newp, newlen)
|
||||
}
|
||||
|
||||
static int
|
||||
user_sysctl(name, namelen, oldp, oldlenp, newp, newlen)
|
||||
const int *name;
|
||||
unsigned int namelen;
|
||||
void *oldp;
|
||||
const void *newp;
|
||||
size_t *oldlenp, newlen;
|
||||
user_sysctl(const int *name, unsigned int namelen,
|
||||
void *oldp, size_t *oldlenp,
|
||||
const void *newp, size_t newlen)
|
||||
{
|
||||
#define _INT(s, n, v, d) { \
|
||||
.sysctl_flags = CTLFLAG_IMMEDIATE|CTLFLAG_PERMANENT| \
|
||||
@@ -317,10 +312,13 @@ user_sysctl(name, namelen, oldp, oldlenp, newp, newlen)
|
||||
if (sysctl_usermib[ni].sysctl_desc == NULL)
|
||||
d1->descr_len = 1;
|
||||
else {
|
||||
size_t dlen;
|
||||
(void)strlcpy(d1->descr_str,
|
||||
sysctl_usermib[ni].sysctl_desc,
|
||||
sizeof(buf) - sizeof(*d1));
|
||||
d1->descr_len = strlen(d1->descr_str) + 1;
|
||||
dlen = strlen(d1->descr_str) + 1;
|
||||
_DIAGASSERT(__type_fit(uint32_t, dlen));
|
||||
d1->descr_len = (uint32_t)dlen;
|
||||
}
|
||||
d = (size_t)__sysc_desc_adv(NULL, d1->descr_len);
|
||||
if (d2 != NULL)
|
||||
|
||||
Reference in New Issue
Block a user