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:
2012-11-15 12:06:41 +01:00
parent f6aac1c3b5
commit f14fb60209
1285 changed files with 44244 additions and 14308 deletions

View File

@@ -1,4 +1,4 @@
/* $NetBSD: rpc_generic.c,v 1.24 2010/12/08 02:06:38 joerg Exp $ */
/* $NetBSD: rpc_generic.c,v 1.26 2012/03/20 17:14:50 matt Exp $ */
/*
* Sun RPC is a product of Sun Microsystems, Inc. and is provided for
@@ -41,7 +41,7 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
__RCSID("$NetBSD: rpc_generic.c,v 1.24 2010/12/08 02:06:38 joerg Exp $");
__RCSID("$NetBSD: rpc_generic.c,v 1.26 2012/03/20 17:14:50 matt Exp $");
#endif
#include "namespace.h"
@@ -109,16 +109,16 @@ static const struct netid_af na_cvt[] = {
};
#if 0
static char *strlocase __P((char *));
static char *strlocase(char *);
#endif
static int getnettype __P((const char *));
static int getnettype(const char *);
/*
* Cache the result of getrlimit(), so we don't have to do an
* expensive call every time.
*/
int
__rpc_dtbsize()
__rpc_dtbsize(void)
{
static int tbsize;
struct rlimit rl;
@@ -142,9 +142,10 @@ __rpc_dtbsize()
*/
u_int
/*ARGSUSED*/
__rpc_get_t_size(af, proto, size)
int af, proto;
int size; /* Size requested */
__rpc_get_t_size(
int af,
int proto,
int size) /* Size requested */
{
int maxsize, defsize;
@@ -171,8 +172,7 @@ __rpc_get_t_size(af, proto, size)
* Find the appropriate address buffer size
*/
u_int
__rpc_get_a_size(af)
int af;
__rpc_get_a_size(int af)
{
switch (af) {
case AF_INET:
@@ -191,8 +191,7 @@ __rpc_get_a_size(af)
#if 0
static char *
strlocase(p)
char *p;
strlocase(char *p)
{
char *t = p;
@@ -210,8 +209,7 @@ strlocase(p)
* If nettype is NULL, it defaults to NETPATH.
*/
static int
getnettype(nettype)
const char *nettype;
getnettype(const char *nettype)
{
int i;
@@ -248,8 +246,7 @@ __rpc_getconfigp_setup(void)
#endif
struct netconfig *
__rpc_getconfip(nettype)
const char *nettype;
__rpc_getconfip(const char *nettype)
{
char *netid;
char *netid_tcp = NULL;
@@ -334,8 +331,7 @@ __rpc_getconfip(nettype)
* __rpc_getconf().
*/
void *
__rpc_setconf(nettype)
const char *nettype;
__rpc_setconf(const char *nettype)
{
struct handle *handle;
@@ -380,8 +376,7 @@ __rpc_setconf(nettype)
* __rpc_setconf() should have been called previously.
*/
struct netconfig *
__rpc_getconf(vhandle)
void *vhandle;
__rpc_getconf(void *vhandle)
{
struct handle *handle;
struct netconfig *nconf;
@@ -457,8 +452,7 @@ __rpc_getconf(vhandle)
}
void
__rpc_endconf(vhandle)
void * vhandle;
__rpc_endconf(void *vhandle)
{
struct handle *handle;
@@ -479,8 +473,7 @@ __rpc_endconf(vhandle)
* Returns NULL if fails, else a non-NULL pointer.
*/
void *
rpc_nullproc(clnt)
CLIENT *clnt;
rpc_nullproc(CLIENT *clnt)
{
struct timeval TIMEOUT = {25, 0};
@@ -496,8 +489,7 @@ rpc_nullproc(clnt)
* one succeeds in finding the netconf for the given fd.
*/
struct netconfig *
__rpcgettp(fd)
int fd;
__rpcgettp(int fd)
{
const char *netid;
struct __rpc_sockinfo si;
@@ -649,8 +641,8 @@ __rpc_taddr2uaddr_af(int af, const struct netbuf *nbuf)
switch (af) {
case AF_INET:
sinp = nbuf->buf;
if (inet_ntop(af, &sinp->sin_addr, namebuf, sizeof namebuf)
== NULL)
if (inet_ntop(af, &sinp->sin_addr, namebuf,
(socklen_t)sizeof namebuf) == NULL)
return NULL;
port = ntohs(sinp->sin_port);
if (asprintf(&ret, "%s.%u.%u", namebuf, ((u_int32_t)port) >> 8,
@@ -660,8 +652,8 @@ __rpc_taddr2uaddr_af(int af, const struct netbuf *nbuf)
#ifdef INET6
case AF_INET6:
sin6 = nbuf->buf;
if (inet_ntop(af, &sin6->sin6_addr, namebuf6, sizeof namebuf6)
== NULL)
if (inet_ntop(af, &sin6->sin6_addr, namebuf6,
(socklen_t)sizeof namebuf6) == NULL)
return NULL;
port = ntohs(sin6->sin6_port);
if (asprintf(&ret, "%s.%u.%u", namebuf6, ((u_int32_t)port) >> 8,
@@ -687,6 +679,7 @@ __rpc_uaddr2taddr_af(int af, const char *uaddr)
struct netbuf *ret = NULL;
char *addrstr, *p;
unsigned port, portlo, porthi;
size_t len;
struct sockaddr_in *sinp;
#ifdef INET6
struct sockaddr_in6 *sin6;
@@ -765,7 +758,9 @@ __rpc_uaddr2taddr_af(int af, const char *uaddr)
memset(sun, 0, sizeof *sun);
sun->sun_family = AF_LOCAL;
strncpy(sun->sun_path, addrstr, sizeof(sun->sun_path) - 1);
ret->len = ret->maxlen = sun->sun_len = SUN_LEN(sun);
len = SUN_LEN(sun);
_DIAGASSERT(__type_fit(uint8_t, len));
ret->len = ret->maxlen = sun->sun_len = (uint8_t)len;
ret->buf = sun;
break;
default:
@@ -893,5 +888,6 @@ __rpc_setnodelay(int fd, const struct __rpc_sockinfo *si)
int one = 1;
if (si->si_proto != IPPROTO_TCP)
return 0;
return setsockopt(fd, si->si_proto, TCP_NODELAY, &one, sizeof(one));
return setsockopt(fd, si->si_proto, TCP_NODELAY, &one,
(socklen_t)sizeof(one));
}