summaryrefslogtreecommitdiffstats
path: root/lib/libc
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/gen/sysctl.310
-rw-r--r--lib/libc/net/getnameinfo.c20
-rw-r--r--lib/libc/net/if_nametoindex.c2
-rw-r--r--lib/libc/posix1e/acl_entry.c2
-rw-r--r--lib/libc/tests/sys/Makefile3
5 files changed, 10 insertions, 27 deletions
diff --git a/lib/libc/gen/sysctl.3 b/lib/libc/gen/sysctl.3
index 7d7b90a..4594d9a 100644
--- a/lib/libc/gen/sysctl.3
+++ b/lib/libc/gen/sysctl.3
@@ -28,7 +28,7 @@
.\" @(#)sysctl.3 8.4 (Berkeley) 5/9/95
.\" $FreeBSD$
.\"
-.Dd May 17, 2013
+.Dd September 10, 2015
.Dt SYSCTL 3
.Os
.Sh NAME
@@ -736,8 +736,6 @@ privilege may change the value.
.It "VM_LOADAVG struct loadavg no"
.It "VM_TOTAL struct vmtotal no"
.It "VM_SWAPPING_ENABLED integer maybe"
-.It "VM_V_CACHE_MAX integer yes"
-.It "VM_V_CACHE_MIN integer yes"
.It "VM_V_FREE_MIN integer yes"
.It "VM_V_FREE_RESERVED integer yes"
.It "VM_V_FREE_TARGET integer yes"
@@ -757,12 +755,6 @@ The returned data consists of a
1 if process swapping is enabled or 0 if disabled.
This variable is
permanently set to 0 if the kernel was built with swapping disabled.
-.It Li VM_V_CACHE_MAX
-Maximum desired size of the cache queue.
-.It Li VM_V_CACHE_MIN
-Minimum desired size of the cache queue.
-If the cache queue size
-falls very far below this value, the pageout daemon is awakened.
.It Li VM_V_FREE_MIN
Minimum amount of memory (cache memory plus free memory)
required to be available before a process waiting on memory will be
diff --git a/lib/libc/net/getnameinfo.c b/lib/libc/net/getnameinfo.c
index f83d0e2..d7e7971 100644
--- a/lib/libc/net/getnameinfo.c
+++ b/lib/libc/net/getnameinfo.c
@@ -78,6 +78,8 @@ getnameinfo(const struct sockaddr *sa, socklen_t salen,
char *host, size_t hostlen, char *serv, size_t servlen,
int flags)
{
+ if (sa == NULL)
+ return (EAI_FAIL);
switch (sa->sa_family) {
case AF_INET:
@@ -124,25 +126,19 @@ getnameinfo_inet(const struct sockaddr *sa, socklen_t salen,
struct servent *sp;
struct hostent *hp;
u_short port;
- int family, i;
const char *addr;
u_int32_t v4a;
int h_error;
char numserv[512];
char numaddr[512];
- if (sa == NULL)
- return EAI_FAIL;
-
- family = sa->sa_family;
- for (i = 0; afdl[i].a_af; i++)
- if (afdl[i].a_af == family) {
- afd = &afdl[i];
- goto found;
- }
- return EAI_FAMILY;
+ for (afd = &afdl[0]; afd->a_af > 0; afd++) {
+ if (afd->a_af == sa->sa_family)
+ break;
+ }
+ if (afd->a_af == 0)
+ return (EAI_FAMILY);
- found:
if (salen != afd->a_socklen)
return EAI_FAIL;
diff --git a/lib/libc/net/if_nametoindex.c b/lib/libc/net/if_nametoindex.c
index 8f04921..debf3fa 100644
--- a/lib/libc/net/if_nametoindex.c
+++ b/lib/libc/net/if_nametoindex.c
@@ -70,9 +70,7 @@ if_nametoindex(const char *ifname)
s = _socket(AF_INET, SOCK_DGRAM | SOCK_CLOEXEC, 0);
if (s != -1) {
-#ifdef PURIFY
memset(&ifr, 0, sizeof(ifr));
-#endif
strlcpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name));
if (_ioctl(s, SIOCGIFINDEX, &ifr) != -1) {
_close(s);
diff --git a/lib/libc/posix1e/acl_entry.c b/lib/libc/posix1e/acl_entry.c
index 3f8ca62..2cffaa3 100644
--- a/lib/libc/posix1e/acl_entry.c
+++ b/lib/libc/posix1e/acl_entry.c
@@ -91,7 +91,7 @@ acl_create_entry_np(acl_t *acl_p, acl_entry_t *entry_p, int offset)
return (-1);
}
- if (offset < 0 || offset >= acl_int->acl_cnt) {
+ if (offset < 0 || offset > acl_int->acl_cnt) {
errno = EINVAL;
return (-1);
}
diff --git a/lib/libc/tests/sys/Makefile b/lib/libc/tests/sys/Makefile
index 7ecf1d6..89431bc 100644
--- a/lib/libc/tests/sys/Makefile
+++ b/lib/libc/tests/sys/Makefile
@@ -25,10 +25,7 @@ NETBSD_ATF_TESTS_C+= kevent_test
NETBSD_ATF_TESTS_C+= kill_test
NETBSD_ATF_TESTS_C+= link_test
NETBSD_ATF_TESTS_C+= listen_test
-# On arm64 triggers panic ARM64TODO: pmap_mincore (PR202307).
-.if ${MACHINE_CPUARCH} != "aarch64"
NETBSD_ATF_TESTS_C+= mincore_test
-.endif
NETBSD_ATF_TESTS_C+= mkdir_test
NETBSD_ATF_TESTS_C+= mkfifo_test
NETBSD_ATF_TESTS_C+= mknod_test
OpenPOWER on IntegriCloud