diff options
author | Peter S. Mazinger <ps.m@gmx.net> | 2005-12-01 20:43:44 +0000 |
---|---|---|
committer | Peter S. Mazinger <ps.m@gmx.net> | 2005-12-01 20:43:44 +0000 |
commit | 8a0b43005ad9ea011b80d66e32b46fb430ddaffb (patch) | |
tree | 418818740042c5dbba244bc1efc760c8d29e47a9 /libc/inet | |
parent | 42b161bb716f35948fabd36472fb59cd0a20fa92 (diff) |
Hide mostly used functions
Diffstat (limited to 'libc/inet')
39 files changed, 289 insertions, 286 deletions
diff --git a/libc/inet/addr.c b/libc/inet/addr.c index 35b590073..a03b7575b 100644 --- a/libc/inet/addr.c +++ b/libc/inet/addr.c @@ -146,7 +146,7 @@ char *inet_ntoa(struct in_addr in) * Formulate an Internet address from network + host. Used in * building addresses stored in the ifnet structure. */ -struct in_addr inet_makeaddr(in_addr_t net, in_addr_t host) +struct in_addr attribute_hidden __inet_makeaddr(in_addr_t net, in_addr_t host) { in_addr_t addr; @@ -161,6 +161,7 @@ struct in_addr inet_makeaddr(in_addr_t net, in_addr_t host) addr = htonl(addr); return (*(struct in_addr *)&addr); } +strong_alias(__inet_makeaddr,inet_makeaddr) #endif diff --git a/libc/inet/getaddrinfo.c b/libc/inet/getaddrinfo.c index 228e04f97..d2d0e151e 100644 --- a/libc/inet/getaddrinfo.c +++ b/libc/inet/getaddrinfo.c @@ -44,7 +44,11 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /* This software is Copyright 1996 by Craig Metz, All Rights Reserved. */ +/* strdupa is using these */ +#if 0 #define memcpy __memcpy +#define strlen __strlen +#endif #define _GNU_SOURCE #define __FORCE_GLIBC @@ -151,7 +155,7 @@ static int addrconfig (sa_family_t af) ret = (errno == EMFILE) ? 1 : 0; else { - close(s); + __close(s); ret = 1; } __set_errno (saved_errno); @@ -175,10 +179,10 @@ gaih_local (const char *name, const struct gaih_service *service, if (name != NULL) { - if (strcmp(name, "localhost") && - strcmp(name, "local") && - strcmp(name, "unix") && - strcmp(name, utsname.nodename)) + if (__strcmp(name, "localhost") && + __strcmp(name, "local") && + __strcmp(name, "unix") && + __strcmp(name, utsname.nodename)) return GAIH_OKIFUNSPEC | -EAI_NONAME; } @@ -205,7 +209,7 @@ gaih_local (const char *name, const struct gaih_service *service, *pai = malloc (sizeof (struct addrinfo) + sizeof (struct sockaddr_un) + ((req->ai_flags & AI_CANONNAME) - ? (strlen(utsname.nodename) + 1): 0)); + ? (__strlen(utsname.nodename) + 1): 0)); if (*pai == NULL) return -EAI_MEMORY; @@ -223,22 +227,22 @@ gaih_local (const char *name, const struct gaih_service *service, #endif /* SALEN */ ((struct sockaddr_un *)(*pai)->ai_addr)->sun_family = AF_LOCAL; - memset(((struct sockaddr_un *)(*pai)->ai_addr)->sun_path, 0, UNIX_PATH_MAX); + __memset(((struct sockaddr_un *)(*pai)->ai_addr)->sun_path, 0, UNIX_PATH_MAX); if (service) { struct sockaddr_un *sunp = (struct sockaddr_un *) (*pai)->ai_addr; - if (strchr (service->name, '/') != NULL) + if (__strchr (service->name, '/') != NULL) { - if (strlen (service->name) >= sizeof (sunp->sun_path)) + if (__strlen (service->name) >= sizeof (sunp->sun_path)) return GAIH_OKIFUNSPEC | -EAI_SERVICE; - strcpy (sunp->sun_path, service->name); + __strcpy (sunp->sun_path, service->name); } else { - if (strlen (P_tmpdir "/") + 1 + strlen (service->name) >= + if (__strlen (P_tmpdir "/") + 1 + __strlen (service->name) >= sizeof (sunp->sun_path)) return GAIH_OKIFUNSPEC | -EAI_SERVICE; @@ -260,7 +264,7 @@ gaih_local (const char *name, const struct gaih_service *service, } if (req->ai_flags & AI_CANONNAME) - (*pai)->ai_canonname = strcpy ((char *) *pai + sizeof (struct addrinfo) + (*pai)->ai_canonname = __strcpy ((char *) *pai + sizeof (struct addrinfo) + sizeof (struct sockaddr_un), utsname.nodename); else @@ -340,7 +344,7 @@ gaih_inet_serv (const char *servicename, const struct gaih_typeproto *tp, } \ (*pat)->next = NULL; \ (*pat)->family = _family; \ - memcpy ((*pat)->addr, h->h_addr_list[i], \ + __memcpy ((*pat)->addr, h->h_addr_list[i], \ sizeof(_type)); \ pat = &((*pat)->next); \ } \ @@ -491,7 +495,7 @@ gaih_inet (const char *name, const struct gaih_service *service, char *namebuf = strdupa (name); char *scope_delim; - scope_delim = strchr (namebuf, SCOPE_DELIMITER); + scope_delim = __strchr (namebuf, SCOPE_DELIMITER); if (scope_delim != NULL) *scope_delim = '\0'; @@ -574,12 +578,12 @@ gaih_inet (const char *name, const struct gaih_service *service, { struct gaih_addrtuple *atr; atr = at = alloca (sizeof (struct gaih_addrtuple)); - memset (at, '\0', sizeof (struct gaih_addrtuple)); + __memset (at, '\0', sizeof (struct gaih_addrtuple)); if (req->ai_family == 0) { at->next = alloca (sizeof (struct gaih_addrtuple)); - memset (at->next, '\0', sizeof (struct gaih_addrtuple)); + __memset (at->next, '\0', sizeof (struct gaih_addrtuple)); } #if __UCLIBC_HAS_IPV6__ @@ -588,7 +592,7 @@ gaih_inet (const char *name, const struct gaih_service *service, extern const struct in6_addr __in6addr_loopback; at->family = AF_INET6; if ((req->ai_flags & AI_PASSIVE) == 0) - memcpy (at->addr, &__in6addr_loopback, sizeof (struct in6_addr)); + __memcpy (at->addr, &__in6addr_loopback, sizeof (struct in6_addr)); atr = at->next; } #endif @@ -660,7 +664,7 @@ gaih_inet (const char *name, const struct gaih_service *service, if (c == NULL) return GAIH_OKIFUNSPEC | -EAI_NONAME; - namelen = strlen (c) + 1; + namelen = __strlen (c) + 1; } else namelen = 0; @@ -704,7 +708,7 @@ gaih_inet (const char *name, const struct gaih_service *service, sin6p->sin6_flowinfo = 0; if (at2->family == AF_INET6) { - memcpy (&sin6p->sin6_addr, + __memcpy (&sin6p->sin6_addr, at2->addr, sizeof (struct in6_addr)); } else @@ -712,7 +716,7 @@ gaih_inet (const char *name, const struct gaih_service *service, sin6p->sin6_addr.s6_addr32[0] = 0; sin6p->sin6_addr.s6_addr32[1] = 0; sin6p->sin6_addr.s6_addr32[2] = htonl(0x0000ffff); - memcpy(&sin6p->sin6_addr.s6_addr32[3], + __memcpy(&sin6p->sin6_addr.s6_addr32[3], at2->addr, sizeof (sin6p->sin6_addr.s6_addr32[3])); } sin6p->sin6_port = st2->port; @@ -724,17 +728,17 @@ gaih_inet (const char *name, const struct gaih_service *service, struct sockaddr_in *sinp = (struct sockaddr_in *) (*pai)->ai_addr; - memcpy (&sinp->sin_addr, + __memcpy (&sinp->sin_addr, at2->addr, sizeof (struct in_addr)); sinp->sin_port = st2->port; - memset (sinp->sin_zero, '\0', sizeof (sinp->sin_zero)); + __memset (sinp->sin_zero, '\0', sizeof (sinp->sin_zero)); } if (c) { (*pai)->ai_canonname = ((void *) (*pai) + sizeof (struct addrinfo) + socklen); - strcpy ((*pai)->ai_canonname, c); + __strcpy ((*pai)->ai_canonname, c); } else (*pai)->ai_canonname = NULL; diff --git a/libc/inet/getnetbynm.c b/libc/inet/getnetbynm.c index 456c337c1..5479c654b 100644 --- a/libc/inet/getnetbynm.c +++ b/libc/inet/getnetbynm.c @@ -30,10 +30,10 @@ getnetbyname(const char *name) setnetent(_net_stayopen); while ((p = getnetent())) { - if (strcmp(p->n_name, name) == 0) + if (__strcmp(p->n_name, name) == 0) break; for (cp = p->n_aliases; *cp != 0; cp++) - if (strcmp(*cp, name) == 0) + if (__strcmp(*cp, name) == 0) goto found; } found: diff --git a/libc/inet/getproto.c b/libc/inet/getproto.c index 85b9fc26f..e7221f3a2 100644 --- a/libc/inet/getproto.c +++ b/libc/inet/getproto.c @@ -213,10 +213,10 @@ int getprotobyname_r(const char *name, LOCK; setprotoent(proto_stayopen); while (!(ret=getprotoent_r(result_buf, buf, buflen, result))) { - if (strcmp(result_buf->p_name, name) == 0) + if (__strcmp(result_buf->p_name, name) == 0) break; for (cp = result_buf->p_aliases; *cp != 0; cp++) - if (strcmp(*cp, name) == 0) + if (__strcmp(*cp, name) == 0) goto found; } found: diff --git a/libc/inet/getservice.c b/libc/inet/getservice.c index a8279e4db..d5402ba3e 100644 --- a/libc/inet/getservice.c +++ b/libc/inet/getservice.c @@ -239,14 +239,14 @@ int getservbyname_r(const char *name, const char *proto, LOCK; setservent(serv_stayopen); while (!(ret=getservent_r(result_buf, buf, buflen, result))) { - if (strcmp(name, result_buf->s_name) == 0) + if (__strcmp(name, result_buf->s_name) == 0) goto gotname; for (cp = result_buf->s_aliases; *cp; cp++) - if (strcmp(name, *cp) == 0) + if (__strcmp(name, *cp) == 0) goto gotname; continue; gotname: - if (proto == 0 || strcmp(result_buf->s_proto, proto) == 0) + if (proto == 0 || __strcmp(result_buf->s_proto, proto) == 0) break; } if (!serv_stayopen) @@ -266,7 +266,7 @@ int getservbyport_r(int port, const char *proto, while (!(ret=getservent_r(result_buf, buf, buflen, result))) { if (result_buf->s_port != port) continue; - if (proto == 0 || strcmp(result_buf->s_proto, proto) == 0) + if (proto == 0 || __strcmp(result_buf->s_proto, proto) == 0) break; } if (!serv_stayopen) diff --git a/libc/inet/hostid.c b/libc/inet/hostid.c index e90cf256c..be3bacb96 100644 --- a/libc/inet/hostid.c +++ b/libc/inet/hostid.c @@ -18,10 +18,10 @@ int sethostid(long int new_id) int ret; if (geteuid() || getuid()) return __set_errno(EPERM); - if ((fd=open(HOSTID,O_CREAT|O_WRONLY,0644))<0) return -1; - ret = write(fd,(void *)&new_id,sizeof(new_id)) == sizeof(new_id) + if ((fd=__open(HOSTID,O_CREAT|O_WRONLY,0644))<0) return -1; + ret = __write(fd,(void *)&new_id,sizeof(new_id)) == sizeof(new_id) ? 0 : -1; - close (fd); + __close (fd); return ret; } @@ -34,12 +34,12 @@ long int gethostid(void) * It is not an error if we cannot read this file. It is not even an * error if we cannot read all the bytes, we just carry on trying... */ - if ((fd=open(HOSTID,O_RDONLY))>=0 && read(fd,(void *)&id,sizeof(id))) + if ((fd=__open(HOSTID,O_RDONLY))>=0 && __read(fd,(void *)&id,sizeof(id))) { - close (fd); + __close (fd); return id; } - if (fd >= 0) close (fd); + if (fd >= 0) __close (fd); /* Try some methods of returning a unique 32 bit id. Clearly IP * numbers, if on the internet, will have a unique address. If they @@ -65,7 +65,7 @@ long int gethostid(void) */ return 0; else { - memcpy((char *) &in, (char *) hp->h_addr, hp->h_length); + __memcpy((char *) &in, (char *) hp->h_addr, hp->h_length); /* Just so it doesn't look exactly like the IP addr */ return(in.s_addr<<16|in.s_addr>>16); diff --git a/libc/inet/if_nametoindex.c b/libc/inet/if_nametoindex.c index 45b319f97..0e556dba8 100644 --- a/libc/inet/if_nametoindex.c +++ b/libc/inet/if_nametoindex.c @@ -51,15 +51,15 @@ unsigned int if_nametoindex(const char* ifname) fd = __opensock(); if (fd < 0) return 0; - strncpy (ifr.ifr_name, ifname, sizeof (ifr.ifr_name)); + __strncpy (ifr.ifr_name, ifname, sizeof (ifr.ifr_name)); if (ioctl(fd,SIOCGIFINDEX,&ifr) < 0) { int saved_errno = errno; - close(fd); + __close(fd); if (saved_errno == EINVAL) __set_errno(ENOSYS); return 0; } - close(fd); + __close(fd); return ifr.ifr_ifindex; #endif /* SIOCGIFINDEX */ @@ -103,7 +103,7 @@ struct if_nameindex * if_nameindex (void) do { ifc.ifc_buf = realloc(ifc.ifc_buf, ifc.ifc_len = rq_len); if (ifc.ifc_buf == NULL || ioctl(fd, SIOCGIFCONF, &ifc) < 0) { - close(fd); + __close(fd); return NULL; } rq_len *= 2; @@ -113,21 +113,21 @@ struct if_nameindex * if_nameindex (void) idx = malloc ((nifs + 1) * sizeof(struct if_nameindex)); if (idx == NULL) { - close(fd); + __close(fd); __set_errno(ENOBUFS); return NULL; } for (i = 0; i < nifs; ++i) { struct ifreq *ifr = &ifc.ifc_req[i]; - idx[i].if_name = strdup (ifr->ifr_name); + idx[i].if_name = __strdup (ifr->ifr_name); if (idx[i].if_name == NULL || ioctl(fd,SIOCGIFINDEX,ifr) < 0) { int saved_errno = errno; unsigned int j; for (j = 0; j < i; ++j) free (idx[j].if_name); free(idx); - close(fd); + __close(fd); if (saved_errno == EINVAL) saved_errno = ENOSYS; else if (saved_errno == ENOMEM) @@ -141,7 +141,7 @@ struct if_nameindex * if_nameindex (void) idx[i].if_index = 0; idx[i].if_name = NULL; - close(fd); + __close(fd); return idx; #endif } @@ -161,13 +161,13 @@ char * if_indextoname (unsigned int ifindex, char *ifname) ifr.ifr_ifindex = ifindex; if (ioctl (fd, SIOCGIFNAME, &ifr) < 0) { saved_errno = errno; - close (fd); + __close (fd); __set_errno (saved_errno); return NULL; } - close (fd); + __close (fd); - return strncpy (ifname, ifr.ifr_name, IFNAMSIZ); + return __strncpy (ifname, ifr.ifr_name, IFNAMSIZ); #else struct if_nameindex *idx; struct if_nameindex *p; @@ -177,7 +177,7 @@ char * if_indextoname (unsigned int ifindex, char *ifname) if (idx != NULL) { for (p = idx; p->if_index || p->if_name; ++p) { if (p->if_index == ifindex) { - result = strncpy (ifname, p->if_name, IFNAMSIZ); + result = __strncpy (ifname, p->if_name, IFNAMSIZ); break; } } diff --git a/libc/inet/ntop.c b/libc/inet/ntop.c index 3a9f5f477..65ff1842b 100644 --- a/libc/inet/ntop.c +++ b/libc/inet/ntop.c @@ -15,8 +15,6 @@ * SOFTWARE. */ -#define memmove __memmove - #define __FORCE_GLIBC #include <features.h> #include <sys/param.h> @@ -78,12 +76,12 @@ inet_ntop4(const u_char *src, char *dst, size_t size) } tmp[i - 1] = '\0'; - if (strlen (tmp) > size) { + if (__strlen (tmp) > size) { __set_errno (ENOSPC); return (NULL); } - return strcpy(dst, tmp); + return __strcpy(dst, tmp); } @@ -116,7 +114,7 @@ inet_ntop6(const u_char *src, char *dst, size_t size) * Copy the input (bytewise) array into a wordwise array. * Find the longest run of 0x00's in src[] for :: shorthanding. */ - memset(words, '\0', sizeof words); + __memset(words, '\0', sizeof words); for (i = 0; i < 16; i += 2) words[i / 2] = (src[i] << 8) | src[i + 1]; best.base = -1; @@ -162,7 +160,7 @@ inet_ntop6(const u_char *src, char *dst, size_t size) (best.len == 6 || (best.len == 5 && words[5] == 0xffff))) { if (!inet_ntop4(src+12, tp, sizeof tmp - (tp - tmp))) return (NULL); - tp += strlen(tp); + tp += __strlen(tp); break; } tp += sprintf(tp, "%x", words[i]); @@ -179,7 +177,7 @@ inet_ntop6(const u_char *src, char *dst, size_t size) __set_errno (ENOSPC); return (NULL); } - return strcpy(dst, tmp); + return __strcpy(dst, tmp); } #endif /* __UCLIBC_HAS_IPV6__ */ @@ -226,7 +224,7 @@ inet_pton4(const char *src, u_char *dst) } if (octets < 4) return (0); - memcpy(dst, tmp, 4); + __memcpy(dst, tmp, 4); return (1); } @@ -263,7 +261,7 @@ inet_pton6(const char *src, u_char *dst) u_int val; - tp = memset(tmp, '\0', 16); + tp = __memset(tmp, '\0', 16); endp = tp + 16; colonp = NULL; /* Leading :: requires some special handling. */ @@ -276,7 +274,7 @@ inet_pton6(const char *src, u_char *dst) while ((ch = tolower (*src++)) != '\0') { const char *pch; - pch = strchr(xdigits, ch); + pch = __strchr(xdigits, ch); if (pch != NULL) { val <<= 4; val |= (pch - xdigits); @@ -335,7 +333,7 @@ inet_pton6(const char *src, u_char *dst) } if (tp != endp) return (0); - memcpy(dst, tmp, 16); + __memcpy(dst, tmp, 16); return (1); } diff --git a/libc/inet/resolv.c b/libc/inet/resolv.c index 0fee6a597..3313bfc85 100644 --- a/libc/inet/resolv.c +++ b/libc/inet/resolv.c @@ -133,7 +133,6 @@ * */ -#define memmove __memmove #define strnlen __strnlen #define strncat __strncat #define strstr __strstr @@ -342,14 +341,14 @@ int attribute_hidden __encode_dotted(const char *dotted, unsigned char *dest, in int used = 0; while (dotted && *dotted) { - char *c = strchr(dotted, '.'); - int l = c ? c - dotted : strlen(dotted); + char *c = __strchr(dotted, '.'); + int l = c ? c - dotted : __strlen(dotted); if (l >= (maxlen - used - 1)) return -1; dest[used++] = l; - memcpy(dest + used, dotted, l); + __memcpy(dest + used, dotted, l); used += l; if (c) @@ -397,7 +396,7 @@ int attribute_hidden __decode_dotted(const unsigned char *data, int offset, if ((used + l + 1) >= maxlen) return -1; - memcpy(dest + used, data + offset, l); + __memcpy(dest + used, data + offset, l); offset += l; used += l; if (measure) @@ -482,7 +481,7 @@ int __decode_question(unsigned char *message, int offset, offset += i; - q->dotted = strdup(temp); + q->dotted = __strdup(temp); q->qtype = (message[offset + 0] << 8) | message[offset + 1]; q->qclass = (message[offset + 2] << 8) | message[offset + 3]; @@ -528,7 +527,7 @@ int attribute_hidden __encode_answer(struct resolv_answer *a, unsigned char *des *dest++ = (a->ttl & 0x000000ff) >> 0; *dest++ = (a->rdlength & 0xff00) >> 8; *dest++ = (a->rdlength & 0x00ff) >> 0; - memcpy(dest, a->rdata, a->rdlength); + __memcpy(dest, a->rdata, a->rdlength); return i + RRFIXEDSZ + a->rdlength; } @@ -547,7 +546,7 @@ int attribute_hidden __decode_answer(unsigned char *message, int offset, message += offset + i; - a->dotted = strdup(temp); + a->dotted = __strdup(temp); a->atype = (message[0] << 8) | message[1]; message += 2; a->aclass = (message[0] << 8) | message[1]; @@ -638,7 +637,7 @@ int __form_query(int id, const char *name, int type, unsigned char *packet, struct resolv_question q; int i, j; - memset(&h, 0, sizeof(h)); + __memset(&h, 0, sizeof(h)); h.id = id; h.qdcount = 1; @@ -714,11 +713,11 @@ int attribute_hidden __dns_lookup(const char *name, int type, int nscount, char while (retries < MAX_RETRIES) { if (fd != -1) - close(fd); + __close(fd); - memset(packet, 0, PACKETSZ); + __memset(packet, 0, PACKETSZ); - memset(&h, 0, sizeof(h)); + __memset(&h, 0, sizeof(h)); ++local_id; local_id &= 0xffff; @@ -734,7 +733,7 @@ int attribute_hidden __dns_lookup(const char *name, int type, int nscount, char if (i < 0) goto fail; - strncpy(lookup,name,MAXDNAME); + __strncpy(lookup,name,MAXDNAME); if (variant >= 0) { BIGLOCK; if (variant < __searchdomains) { @@ -865,7 +864,7 @@ int attribute_hidden __dns_lookup(const char *name, int type, int nscount, char ma.buf = a->buf; ma.buflen = a->buflen; ma.add_count = a->add_count; - memcpy(a, &ma, sizeof(ma)); + __memcpy(a, &ma, sizeof(ma)); if (a->atype != T_SIG && (0 == a->buf || (type != T_A && type != T_AAAA))) { break; @@ -897,7 +896,7 @@ int attribute_hidden __dns_lookup(const char *name, int type, int nscount, char ma.rdlength, a->rdlength); goto again; } - memcpy(a->buf + (a->add_count * ma.rdlength), ma.rdata, ma.rdlength); + __memcpy(a->buf + (a->add_count * ma.rdlength), ma.rdata, ma.rdlength); ++a->add_count; } } @@ -905,7 +904,7 @@ int attribute_hidden __dns_lookup(const char *name, int type, int nscount, char DPRINTF("Answer name = |%s|\n", a->dotted); DPRINTF("Answer type = |%d|\n", a->atype); - close(fd); + __close(fd); if (outpacket) *outpacket = packet; @@ -957,7 +956,7 @@ int attribute_hidden __dns_lookup(const char *name, int type, int nscount, char fail: if (fd != -1) - close(fd); + __close(fd); if (lookup) free(lookup); if (packet) @@ -1022,21 +1021,21 @@ int attribute_hidden __open_nameservers() *p++ = '\0'; } - if (strcmp(argv[0], "nameserver") == 0) { + if (__strcmp(argv[0], "nameserver") == 0) { for (i = 1; i < argc && __nameservers < MAX_SERVERS; i++) { - __nameserver[__nameservers++] = strdup(argv[i]); + __nameserver[__nameservers++] = __strdup(argv[i]); DPRINTF("adding nameserver %s\n", argv[i]); } } /* domain and search are mutually exclusive, the last one wins */ - if (strcmp(argv[0],"domain")==0 || strcmp(argv[0],"search")==0) { + if (__strcmp(argv[0],"domain")==0 || __strcmp(argv[0],"search")==0) { while (__searchdomains > 0) { free(__searchdomain[--__searchdomains]); __searchdomain[__searchdomains] = NULL; } for (i=1; i < argc && __searchdomains < MAX_SEARCH; i++) { - __searchdomain[__searchdomains++] = strdup(argv[i]); + __searchdomain[__searchdomains++] = __strdup(argv[i]); DPRINTF("adding search %s\n", argv[i]); } } @@ -1187,7 +1186,7 @@ int res_query(const char *dname, int class, int type, return(-1); } - memset((char *) &a, '\0', sizeof(a)); + __memset((char *) &a, '\0', sizeof(a)); BIGLOCK; __nameserversXX=__nameservers; @@ -1204,7 +1203,7 @@ int res_query(const char *dname, int class, int type, if (a.atype == type) { /* CNAME*/ int len = MIN(anslen, i); - memcpy(answer, packet, len); + __memcpy(answer, packet, len); if (packet) free(packet); return(len); @@ -1380,19 +1379,19 @@ int res_querydomain(name, domain, class, type, answer, anslen) * Check for trailing '.'; * copy without '.' if present. */ - n = strlen(name); + n = __strlen(name); if (n + 1 > sizeof(nbuf)) { h_errno = NO_RECOVERY; return (-1); } if (n > 0 && name[--n] == '.') { - strncpy(nbuf, name, n); + __strncpy(nbuf, name, n); nbuf[n] = '\0'; } else longname = name; } else { - n = strlen(name); - d = strlen(domain); + n = __strlen(name); + d = __strlen(domain); if (n + 1 + d + 1 > sizeof(nbuf)) { h_errno = NO_RECOVERY; return (-1); @@ -1509,7 +1508,7 @@ int attribute_hidden __read_etc_hosts_r(FILE * fp, const char * name, int type, *h_errnop=HOST_NOT_FOUND; while (fgets(buf, buflen, fp)) { - if ((cp = strchr(buf, '#'))) + if ((cp = __strchr(buf, '#'))) *cp = '\0'; DPRINTF("Looking at: %s\n", buf); aliases = 0; @@ -1534,7 +1533,7 @@ int attribute_hidden __read_etc_hosts_r(FILE * fp, const char * name, int type, /* Return whatever the next entry happens to be. */ break; } else if (action==GET_HOSTS_BYADDR) { - if (strcmp(name, alias[0]) != 0) + if (__strcmp(name, alias[0]) != 0) continue; } else { /* GET_HOSTS_BYNAME */ @@ -1765,12 +1764,12 @@ int getnameinfo (const struct sockaddr *sa, socklen_t addrlen, char *host, && (getdomainname (domain, sizeof(domain)) == 0) && (c = strstr (h->h_name, domain)) && (c != h->h_name) && (*(--c) == '.')) { - strncpy (host, h->h_name, + __strncpy (host, h->h_name, min(hostlen, (size_t) (c - h->h_name))); host[min(hostlen - 1, (size_t) (c - h->h_name))] = '\0'; ok = 1; } else { - strncpy (host, h->h_name, hostlen); + __strncpy (host, h->h_name, hostlen); ok = 1; } } @@ -1811,7 +1810,7 @@ int getnameinfo (const struct sockaddr *sa, socklen_t addrlen, char *host, if (if_indextoname (scopeid, scopeptr) == NULL) ++ni_numericscope; else - scopelen = strlen (scopebuf); + scopelen = __strlen (scopebuf); } else { ++ni_numericscope; } @@ -1825,7 +1824,7 @@ int getnameinfo (const struct sockaddr *sa, socklen_t addrlen, char *host, if (real_hostlen + scopelen + 1 > hostlen) return EAI_SYSTEM; - memcpy (host + real_hostlen, scopebuf, scopelen + 1); + __memcpy (host + real_hostlen, scopebuf, scopelen + 1); } #endif } else @@ -1848,7 +1847,7 @@ int getnameinfo (const struct sockaddr *sa, socklen_t addrlen, char *host, struct utsname utsname; if (!uname (&utsname)) { - strncpy (host, utsname.nodename, hostlen); + __strncpy (host, utsname.nodename, hostlen); break; }; }; @@ -1858,7 +1857,7 @@ int getnameinfo (const struct sockaddr *sa, socklen_t addrlen, char *host, return EAI_NONAME; } - strncpy (host, "localhost", hostlen); + __strncpy (host, "localhost", hostlen); break; default: @@ -1876,7 +1875,7 @@ int getnameinfo (const struct sockaddr *sa, socklen_t addrlen, char *host, s = getservbyport (((const struct sockaddr_in *) sa)->sin_port, ((flags & NI_DGRAM) ? "udp" : "tcp")); if (s) { - strncpy (serv, s->s_name, servlen); + __strncpy (serv, s->s_name, servlen); break; } } @@ -1885,7 +1884,7 @@ int getnameinfo (const struct sockaddr *sa, socklen_t addrlen, char *host, break; case AF_LOCAL: - strncpy (serv, ((const struct sockaddr_un *) sa)->sun_path, servlen); + __strncpy (serv, ((const struct sockaddr_un *) sa)->sun_path, servlen); break; } } @@ -1970,7 +1969,7 @@ int gethostbyname_r(const char * name, if (buflen<256) return ERANGE; - strncpy(buf, name, buflen); + __strncpy(buf, name, buflen); alias[0] = buf; alias[1] = NULL; @@ -2014,7 +2013,7 @@ int gethostbyname_r(const char * name, } else if(a.add_count > 0) { - memmove(buf - sizeof(struct in_addr*)*2, buf, a.add_count * a.rdlength); + __memmove(buf - sizeof(struct in_addr*)*2, buf, a.add_count * a.rdlength); addr_list = (struct in_addr**)(buf + a.add_count * a.rdlength); addr_list[0] = in; for (i = a.add_count-1; i>=0; --i) @@ -2024,11 +2023,11 @@ int gethostbyname_r(const char * name, buf = (char*)&addr_list[a.add_count + 2]; } - strncpy(buf, a.dotted, buflen); + __strncpy(buf, a.dotted, buflen); free(a.dotted); if (a.atype == T_A) { /* ADDRESS */ - memcpy(in, a.rdata, sizeof(*in)); + __memcpy(in, a.rdata, sizeof(*in)); result_buf->h_name = buf; result_buf->h_addrtype = AF_INET; result_buf->h_length = sizeof(*in); @@ -2127,7 +2126,7 @@ int gethostbyname2_r(const char *name, int family, if (buflen<256) return ERANGE; - strncpy(buf, name, buflen); + __strncpy(buf, name, buflen); /* First check if this is already an address */ if (inet_pton(AF_INET6, name, in)) { @@ -2140,7 +2139,7 @@ int gethostbyname2_r(const char *name, int family, return NETDB_SUCCESS; } - memset((char *) &a, '\0', sizeof(a)); + __memset((char *) &a, '\0', sizeof(a)); for (;;) { BIGLOCK; @@ -2155,7 +2154,7 @@ int gethostbyname2_r(const char *name, int family, return TRY_AGAIN; } - strncpy(buf, a.dotted, buflen); + __strncpy(buf, a.dotted, buflen); free(a.dotted); if (a.atype == T_CNAME) { /* CNAME */ @@ -2173,7 +2172,7 @@ int gethostbyname2_r(const char *name, int family, } continue; } else if (a.atype == T_AAAA) { /* ADDRESS */ - memcpy(in, a.rdata, sizeof(*in)); + __memcpy(in, a.rdata, sizeof(*in)); result_buf->h_name = buf; result_buf->h_addrtype = AF_INET6; result_buf->h_length = sizeof(*in); @@ -2221,7 +2220,7 @@ int gethostbyaddr_r (const void *addr, socklen_t len, int type, if (!addr) return EINVAL; - memset((char *) &a, '\0', sizeof(a)); + __memset((char *) &a, '\0', sizeof(a)); switch (type) { case AF_INET: @@ -2295,7 +2294,7 @@ int gethostbyaddr_r (const void *addr, socklen_t len, int type, if(type == AF_INET) { unsigned char *tmp_addr = (unsigned char *)addr; - memcpy(&in->s_addr, addr, len); + __memcpy(&in->s_addr, addr, len); addr_list[0] = in; @@ -2303,7 +2302,7 @@ int gethostbyaddr_r (const void *addr, socklen_t len, int type, tmp_addr[3], tmp_addr[2], tmp_addr[1], tmp_addr[0]); #ifdef __UCLIBC_HAS_IPV6__ } else { - memcpy(in6->s6_addr, addr, len); + __memcpy(in6->s6_addr, addr, len); addr_list6[0] = in6; qp = buf; @@ -2312,7 +2311,7 @@ int gethostbyaddr_r (const void *addr, socklen_t len, int type, qp += sprintf(qp, "%x.%x.", in6->s6_addr[i] & 0xf, (in6->s6_addr[i] >> 4) & 0xf); } - strcpy(qp, "ip6.int"); + __strcpy(qp, "ip6.int"); #endif /* __UCLIBC_HAS_IPV6__ */ } @@ -2331,7 +2330,7 @@ int gethostbyaddr_r (const void *addr, socklen_t len, int type, return TRY_AGAIN; } - strncpy(buf, a.dotted, buflen); + __strncpy(buf, a.dotted, buflen); free(a.dotted); if (a.atype == T_CNAME) { /* CNAME */ @@ -2570,7 +2569,7 @@ int attribute_hidden __libc_ns_name_unpack(const u_char *msg, const u_char *eom, } checked += n + 1; *dstp++ = n; - memcpy(dstp, srcp, n); + __memcpy(dstp, srcp, n); dstp += n; srcp += n; break; diff --git a/libc/inet/rpc/auth_unix.c b/libc/inet/rpc/auth_unix.c index 787e08b13..c02cc309b 100644 --- a/libc/inet/rpc/auth_unix.c +++ b/libc/inet/rpc/auth_unix.c @@ -152,7 +152,7 @@ no_memory: au->au_origcred.oa_base = mem_alloc ((u_int) len); if (au->au_origcred.oa_base == NULL) goto no_memory; - memcpy(au->au_origcred.oa_base, mymem, (u_int) len); + __memcpy(au->au_origcred.oa_base, mymem, (u_int) len); /* * set auth handle to reflect new cred. diff --git a/libc/inet/rpc/bindresvport.c b/libc/inet/rpc/bindresvport.c index 1234f0682..98ce691ee 100644 --- a/libc/inet/rpc/bindresvport.c +++ b/libc/inet/rpc/bindresvport.c @@ -58,7 +58,7 @@ bindresvport (int sd, struct sockaddr_in *sin) if (sin == (struct sockaddr_in *) 0) { sin = &myaddr; - memset (sin, 0, sizeof (*sin)); + __memset (sin, 0, sizeof (*sin)); sin->sin_family = AF_INET; } else if (sin->sin_family != AF_INET) diff --git a/libc/inet/rpc/clnt_generic.c b/libc/inet/rpc/clnt_generic.c index c8fe545c3..3e2998477 100644 --- a/libc/inet/rpc/clnt_generic.c +++ b/libc/inet/rpc/clnt_generic.c @@ -63,11 +63,11 @@ clnt_create (const char *hostname, u_long prog, u_long vers, CLIENT *client; int herr; - if (strcmp (proto, "unix") == 0) + if (__strcmp (proto, "unix") == 0) { - memset ((char *)&sun, 0, sizeof (sun)); + __memset ((char *)&sun, 0, sizeof (sun)); sun.sun_family = AF_UNIX; - strcpy (sun.sun_path, hostname); + __strcpy (sun.sun_path, hostname); sock = RPC_ANYSOCK; client = clntunix_create (&sun, prog, vers, &sock, 0, 0); if (client == NULL) @@ -112,8 +112,8 @@ clnt_create (const char *hostname, u_long prog, u_long vers, } sin.sin_family = h->h_addrtype; sin.sin_port = 0; - memset (sin.sin_zero, 0, sizeof (sin.sin_zero)); - memcpy ((char *) &sin.sin_addr, h->h_addr, h->h_length); + __memset (sin.sin_zero, 0, sizeof (sin.sin_zero)); + __memcpy ((char *) &sin.sin_addr, h->h_addr, h->h_length); prtbuflen = 1024; prttmpbuf = alloca (prtbuflen); diff --git a/libc/inet/rpc/clnt_perror.c b/libc/inet/rpc/clnt_perror.c index 1c9ca88ae..595ddde9a 100644 --- a/libc/inet/rpc/clnt_perror.c +++ b/libc/inet/rpc/clnt_perror.c @@ -91,8 +91,8 @@ clnt_sperror (CLIENT * rpch, const char *msg) len = sprintf (str, "%s: ", msg); str += len; - (void) strcpy(str, clnt_sperrno(e.re_status)); - str += strlen(str); + (void) __strcpy(str, clnt_sperrno(e.re_status)); + str += __strlen(str); switch (e.re_status) { @@ -126,13 +126,13 @@ clnt_sperror (CLIENT * rpch, const char *msg) case RPC_AUTHERROR: err = auth_errmsg (e.re_why); - (void) strcpy(str, _("; why = ")); - str += strlen(str); + (void) __strcpy(str, _("; why = ")); + str += __strlen(str); if (err != NULL) { - (void) strcpy(str, err); - str += strlen(str); + (void) __strcpy(str, err); + str += __strlen(str); } else { @@ -316,27 +316,27 @@ clnt_spcreateerror (const char *msg) ce = &get_rpc_createerr (); len = sprintf (str, "%s: ", msg); cp = str + len; - (void) strcpy(cp, clnt_sperrno (ce->cf_stat)); - cp += strlen(cp); + (void) __strcpy(cp, clnt_sperrno (ce->cf_stat)); + cp += __strlen(cp); switch (ce->cf_stat) { case RPC_PMAPFAILURE: - (void) strcpy(cp, " - "); - cp += strlen(cp); + (void) __strcpy(cp, " - "); + cp += __strlen(cp); - (void) strcpy(cp, clnt_sperrno (ce->cf_error.re_status)); - cp += strlen(cp); + (void) __strcpy(cp, clnt_sperrno (ce->cf_error.re_status)); + cp += __strlen(cp); break; case RPC_SYSTEMERROR: - (void) strcpy(cp, " - "); - cp += strlen(cp); + (void) __strcpy(cp, " - "); + cp += __strlen(cp); strerror_r (ce->cf_error.re_errno, chrbuf, sizeof chrbuf); - (void) strcpy(cp, chrbuf); - cp += strlen(cp); + (void) __strcpy(cp, chrbuf); + cp += __strlen(cp); break; default: break; diff --git a/libc/inet/rpc/clnt_simple.c b/libc/inet/rpc/clnt_simple.c index b9d315aef..dede4a028 100644 --- a/libc/inet/rpc/clnt_simple.c +++ b/libc/inet/rpc/clnt_simple.c @@ -87,7 +87,7 @@ callrpc (const char *host, u_long prognum, u_long versnum, u_long procnum, crp->socket = RPC_ANYSOCK; } if (crp->valid && crp->oldprognum == prognum && crp->oldversnum == versnum - && strcmp (crp->oldhost, host) == 0) + && __strcmp (crp->oldhost, host) == 0) { /* reuse old client */ } @@ -100,7 +100,7 @@ callrpc (const char *host, u_long prognum, u_long versnum, u_long procnum, crp->valid = 0; if (crp->socket != RPC_ANYSOCK) { - (void) close (crp->socket); + (void) __close (crp->socket); crp->socket = RPC_ANYSOCK; } if (crp->client) @@ -125,7 +125,7 @@ callrpc (const char *host, u_long prognum, u_long versnum, u_long procnum, timeout.tv_usec = 0; timeout.tv_sec = 5; - memcpy ((char *) &server_addr.sin_addr, hp->h_addr, hp->h_length); + __memcpy ((char *) &server_addr.sin_addr, hp->h_addr, hp->h_length); server_addr.sin_family = AF_INET; server_addr.sin_port = 0; if ((crp->client = clntudp_create (&server_addr, (u_long) prognum, @@ -134,7 +134,7 @@ callrpc (const char *host, u_long prognum, u_long versnum, u_long procnum, crp->valid = 1; crp->oldprognum = prognum; crp->oldversnum = versnum; - (void) strncpy (crp->oldhost, host, 255); + (void) __strncpy (crp->oldhost, host, 255); crp->oldhost[255] = '\0'; } tottimeout.tv_sec = 25; diff --git a/libc/inet/rpc/clnt_tcp.c b/libc/inet/rpc/clnt_tcp.c index 62c95bbf0..ad2797a9e 100644 --- a/libc/inet/rpc/clnt_tcp.c +++ b/libc/inet/rpc/clnt_tcp.c @@ -175,7 +175,7 @@ clnttcp_create (struct sockaddr_in *raddr, u_long prog, u_long vers, ce->cf_stat = RPC_SYSTEMERROR; ce->cf_error.re_errno = errno; if (*sockp >= 0) - (void) close (*sockp); + (void) __close (*sockp); goto fooy; } ct->ct_closeit = TRUE; @@ -211,7 +211,7 @@ clnttcp_create (struct sockaddr_in *raddr, u_long prog, u_long vers, { if (ct->ct_closeit) { - (void) close (*sockp); + (void) __close (*sockp); } goto fooy; } @@ -464,7 +464,7 @@ clnttcp_destroy (CLIENT *h) if (ct->ct_closeit) { - (void) close (ct->ct_sock); + (void) __close (ct->ct_sock); } XDR_DESTROY (&(ct->ct_xdrs)); mem_free ((caddr_t) ct, sizeof (struct ct_data)); @@ -506,7 +506,7 @@ readtcp (char *ctptr, char *buf, int len) } break; } - switch (len = read (ct->ct_sock, buf, len)) + switch (len = __read (ct->ct_sock, buf, len)) { case 0: @@ -532,7 +532,7 @@ writetcp (char *ctptr, char *buf, int len) for (cnt = len; cnt > 0; cnt -= i, buf += i) { - if ((i = write (ct->ct_sock, buf, cnt)) == -1) + if ((i = __write (ct->ct_sock, buf, cnt)) == -1) { ct->ct_error.re_errno = errno; ct->ct_error.re_status = RPC_CANTSEND; diff --git a/libc/inet/rpc/clnt_udp.c b/libc/inet/rpc/clnt_udp.c index bd25e4b33..5a7e35e80 100644 --- a/libc/inet/rpc/clnt_udp.c +++ b/libc/inet/rpc/clnt_udp.c @@ -405,13 +405,13 @@ send_again: msg.msg_controllen = 256; ret = recvmsg (cu->cu_sock, &msg, MSG_ERRQUEUE); if (ret >= 0 - && memcmp (cbuf + 256, cu->cu_outbuf, ret) == 0 + && __memcmp (cbuf + 256, cu->cu_outbuf, ret) == 0 && (msg.msg_flags & MSG_ERRQUEUE) && ((msg.msg_namelen == 0 && ret >= 12) || (msg.msg_namelen == sizeof (err_addr) && err_addr.sin_family == AF_INET - && memcmp (&err_addr.sin_addr, &cu->cu_raddr.sin_addr, + && __memcmp (&err_addr.sin_addr, &cu->cu_raddr.sin_addr, sizeof (err_addr.sin_addr)) == 0 && err_addr.sin_port == cu->cu_raddr.sin_port))) for (cmsg = CMSG_FIRSTHDR (&msg); cmsg; @@ -606,7 +606,7 @@ clntudp_destroy (CLIENT *cl) if (cu->cu_closeit) { - (void) close (cu->cu_sock); + (void) __close (cu->cu_sock); } XDR_DESTROY (&(cu->cu_outxdrs)); mem_free ((caddr_t) cu, (sizeof (*cu) + cu->cu_sendsz + cu->cu_recvsz)); diff --git a/libc/inet/rpc/clnt_unix.c b/libc/inet/rpc/clnt_unix.c index a6ac295ad..93ea42afd 100644 --- a/libc/inet/rpc/clnt_unix.c +++ b/libc/inet/rpc/clnt_unix.c @@ -149,7 +149,7 @@ clntunix_create (struct sockaddr_un *raddr, u_long prog, u_long vers, if (*sockp < 0) { *sockp = socket (AF_UNIX, SOCK_STREAM, 0); - len = strlen (raddr->sun_path) + sizeof (raddr->sun_family) + 1; + len = __strlen (raddr->sun_path) + sizeof (raddr->sun_family) + 1; if (*sockp < 0 || connect (*sockp, (struct sockaddr *) raddr, len) < 0) { @@ -157,7 +157,7 @@ clntunix_create (struct sockaddr_un *raddr, u_long prog, u_long vers, ce->cf_stat = RPC_SYSTEMERROR; ce->cf_error.re_errno = errno; if (*sockp != -1) - close (*sockp); + __close (*sockp); goto fooy; } ct->ct_closeit = TRUE; @@ -191,7 +191,7 @@ clntunix_create (struct sockaddr_un *raddr, u_long prog, u_long vers, if (!xdr_callhdr (&(ct->ct_xdrs), &call_msg)) { if (ct->ct_closeit) - close (*sockp); + __close (*sockp); goto fooy; } ct->ct_mpos = XDR_GETPOS (&(ct->ct_xdrs)); @@ -437,7 +437,7 @@ clntunix_destroy (CLIENT *h) if (ct->ct_closeit) { - (void) close (ct->ct_sock); + (void) __close (ct->ct_sock); } XDR_DESTROY (&(ct->ct_xdrs)); mem_free ((caddr_t) ct, sizeof (struct ct_data)); @@ -510,7 +510,7 @@ __msgwrite (int sock, void *data, size_t cnt) cred.uid = geteuid (); cred.gid = getegid (); - memcpy (CMSG_DATA(cmsg), &cred, sizeof (struct ucred)); + __memcpy (CMSG_DATA(cmsg), &cred, sizeof (struct ucred)); cmsg->cmsg_level = SOL_SOCKET; cmsg->cmsg_type = SCM_CREDENTIALS; cmsg->cmsg_len = sizeof(*cmsg) + sizeof(struct ucred); diff --git a/libc/inet/rpc/get_myaddress.c b/libc/inet/rpc/get_myaddress.c index 7674a7a46..ef2c2f52e 100644 --- a/libc/inet/rpc/get_myaddress.c +++ b/libc/inet/rpc/get_myaddress.c @@ -94,7 +94,7 @@ get_myaddress (struct sockaddr_in *addr) { *addr = *((struct sockaddr_in *) &ifr->ifr_addr); addr->sin_port = htons (PMAPPORT); - close (s); + __close (s); return; } ifr++; @@ -104,5 +104,5 @@ get_myaddress (struct sockaddr_in *addr) loopback = 1; goto again; } - close (s); + __close (s); } diff --git a/libc/inet/rpc/getrpcent.c b/libc/inet/rpc/getrpcent.c index 56fbbbe45..c261dfb3b 100644 --- a/libc/inet/rpc/getrpcent.c +++ b/libc/inet/rpc/getrpcent.c @@ -96,10 +96,10 @@ struct rpcent *getrpcbyname(const char *name) setrpcent(0); while ((rpc = getrpcent())) { - if (strcmp(rpc->r_name, name) == 0) + if (__strcmp(rpc->r_name, name) == 0) return rpc; for (rp = rpc->r_aliases; *rp != NULL; rp++) { - if (strcmp(*rp, name) == 0) + if (__strcmp(*rp, name) == 0) return rpc; } } @@ -166,8 +166,8 @@ static char *firstwhite(char *s) { char *s1, *s2; - s1 = strchr(s, ' '); - s2 = strchr(s, '\t'); + s1 = __strchr(s, ' '); + s2 = __strchr(s, '\t'); if (s1) { if (s2) return (s1 < s2) ? s1 : s2; @@ -184,12 +184,12 @@ static struct rpcent *interpret(register struct rpcdata *d) register char *cp, **q; p = d->line; - d->line[strlen(p)-1] = '\n'; + d->line[__strlen(p)-1] = '\n'; if (*p == '#') return __get_next_rpcent(d); - cp = strchr(p, '#'); + cp = __strchr(p, '#'); if (cp == NULL) { - cp = strchr(p, '\n'); + cp = __strchr(p, '\n'); if (cp == NULL) return __get_next_rpcent(d); } @@ -200,9 +200,9 @@ static struct rpcent *interpret(register struct rpcdata *d) else return __get_next_rpcent(d); #else - cp = strchr(p, ' '); + cp = __strchr(p, ' '); if (cp == NULL) { - cp = strchr(p, '\t'); + cp = __strchr(p, '\t'); if (cp == NULL) return __get_next_rpcent(d); } @@ -218,11 +218,11 @@ static struct rpcent *interpret(register struct rpcdata *d) if ((cp = firstwhite(cp))) *cp++ = '\0'; #else - cp = strchr(p, ' '); + cp = __strchr(p, ' '); if (cp != NULL) *cp++ = '\0'; else { - cp = strchr(p, '\t'); + cp = __strchr(p, '\t'); if (cp != NULL) *cp++ = '\0'; } @@ -238,11 +238,11 @@ static struct rpcent *interpret(register struct rpcdata *d) if ((cp = firstwhite(cp))) *cp++ = '\0'; #else - cp = strchr(p, ' '); + cp = __strchr(p, ' '); if (cp != NULL) *cp++ = '\0'; else { - cp = strchr(p, '\t'); + cp = __strchr(p, '\t'); if (cp != NULL) *cp++ = '\0'; } @@ -275,8 +275,8 @@ static int __copy_rpcent(struct rpcent *r, struct rpcent *result_buf, char *buff return ENOENT; /* copy the struct from the shared mem */ - memset(result_buf, 0x00, sizeof(*result_buf)); - memset(buffer, 0x00, buflen); + __memset(result_buf, 0x00, sizeof(*result_buf)); + __memset(buffer, 0x00, buflen); result_buf->r_number = r->r_number; @@ -293,21 +293,21 @@ static int __copy_rpcent(struct rpcent *r, struct rpcent *result_buf, char *buff buflen -= s; while (i-- > 0) { - s = strlen(r->r_aliases[i]) + 1; + s = __strlen(r->r_aliases[i]) + 1; if (buflen < s) goto err_out; result_buf->r_aliases[i] = buffer; buffer += s; buflen -= s; - memcpy(result_buf->r_aliases[i], r->r_aliases[i], s); + __memcpy(result_buf->r_aliases[i], r->r_aliases[i], s); } /* copy the name */ - i = strlen(r->r_name); + i = __strlen(r->r_name); if (buflen <= i) goto err_out; result_buf->r_name = buffer; - memcpy(result_buf->r_name, r->r_name, i); + __memcpy(result_buf->r_name, r->r_name, i); /* that was a hoot eh ? */ *result = result_buf; diff --git a/libc/inet/rpc/getrpcport.c b/libc/inet/rpc/getrpcport.c index 851a1c487..5470fbff6 100644 --- a/libc/inet/rpc/getrpcport.c +++ b/libc/inet/rpc/getrpcport.c @@ -70,7 +70,7 @@ getrpcport (const char *host, u_long prognum, u_long versnum, u_int proto) buffer = alloca (buflen); } - memcpy ((char *) &addr.sin_addr, hp->h_addr, hp->h_length); + __memcpy ((char *) &addr.sin_addr, hp->h_addr, hp->h_length); addr.sin_family = AF_INET; addr.sin_port = 0; return pmap_getport (&addr, prognum, versnum, proto); diff --git a/libc/inet/rpc/pmap_clnt.c b/libc/inet/rpc/pmap_clnt.c index 2382c153b..5bbc81564 100644 --- a/libc/inet/rpc/pmap_clnt.c +++ b/libc/inet/rpc/pmap_clnt.c @@ -90,7 +90,7 @@ __get_myaddress (struct sockaddr_in *addr) { *addr = *((struct sockaddr_in *) &ifr->ifr_addr); addr->sin_port = htons (PMAPPORT); - close (s); + __close (s); return TRUE; } ifr++; @@ -100,7 +100,7 @@ __get_myaddress (struct sockaddr_in *addr) loopback = 0; goto again; } - close (s); + __close (s); return FALSE; } @@ -139,7 +139,7 @@ pmap_set (u_long program, u_long version, int protocol, u_short port) return FALSE; } CLNT_DESTROY (client); - /* (void)close(socket); CLNT_DESTROY closes it */ + /* (void)__close(socket); CLNT_DESTROY closes it */ return rslt; } @@ -168,6 +168,6 @@ pmap_unset (u_long program, u_long version) CLNT_CALL (client, PMAPPROC_UNSET, (xdrproc_t)xdr_pmap, (caddr_t)&parms, (xdrproc_t)xdr_bool, (caddr_t)&rslt, tottimeout); CLNT_DESTROY (client); - /* (void)close(socket); CLNT_DESTROY already closed it */ + /* (void)__close(socket); CLNT_DESTROY already closed it */ return rslt; } diff --git a/libc/inet/rpc/pmap_getmaps.c b/libc/inet/rpc/pmap_getmaps.c index c435dea4e..4ec2d40e9 100644 --- a/libc/inet/rpc/pmap_getmaps.c +++ b/libc/inet/rpc/pmap_getmaps.c @@ -74,7 +74,7 @@ pmap_getmaps (struct sockaddr_in *address) } CLNT_DESTROY (client); } - /* (void)close(socket); CLNT_DESTROY already closed it */ + /* (void)__close(socket); CLNT_DESTROY already closed it */ address->sin_port = 0; return head; } diff --git a/libc/inet/rpc/pmap_getport.c b/libc/inet/rpc/pmap_getport.c index 6d68ef01f..45ed4eae8 100644 --- a/libc/inet/rpc/pmap_getport.c +++ b/libc/inet/rpc/pmap_getport.c @@ -88,7 +88,7 @@ pmap_getport (address, program, version, protocol) } CLNT_DESTROY (client); } - /* (void)close(socket); CLNT_DESTROY already closed it */ + /* (void)__close(socket); CLNT_DESTROY already closed it */ address->sin_port = 0; return port; } diff --git a/libc/inet/rpc/pmap_rmt.c b/libc/inet/rpc/pmap_rmt.c index 04f558fe2..db875e987 100644 --- a/libc/inet/rpc/pmap_rmt.c +++ b/libc/inet/rpc/pmap_rmt.c @@ -40,6 +40,7 @@ static char sccsid[] = "@(#)pmap_rmt.c 1.21 87/08/27 Copyr 1984 Sun Micro"; */ #define authunix_create_default __authunix_create_default +#define inet_makeaddr __inet_makeaddr #define __FORCE_GLIBC #include <features.h> @@ -281,7 +282,7 @@ clnt_broadcast (prog, vers, proc, xargs, argsp, xresults, resultsp, eachresult) fd.fd = sock; fd.events = POLLIN; nets = getbroadcastnets (addrs, sock, inbuf); - memset ((char *) &baddr, 0, sizeof (baddr)); + __memset ((char *) &baddr, 0, sizeof (baddr)); baddr.sin_family = AF_INET; baddr.sin_port = htons (PMAPPORT); baddr.sin_addr.s_addr = htonl (INADDR_ANY); @@ -409,7 +410,7 @@ clnt_broadcast (prog, vers, proc, xargs, argsp, xresults, resultsp, eachresult) } } done_broad: - (void) close (sock); + (void) __close (sock); AUTH_DESTROY (unix_auth); return stat; } diff --git a/libc/inet/rpc/rcmd.c b/libc/inet/rpc/rcmd.c index cb4866b7a..a51d09fcd 100644 --- a/libc/inet/rpc/rcmd.c +++ b/libc/inet/rpc/rcmd.c @@ -155,7 +155,7 @@ int rcmd(ahost, rport, locuser, remuser, cmd, fd2p) sin.sin_port = rport; if (connect(s, (struct sockaddr *)&sin, sizeof(sin)) >= 0) /* __connect */ break; - (void)close(s); /* __close */ + (void)__close(s); if (errno == EADDRINUSE) { lport--; continue; @@ -185,7 +185,7 @@ int rcmd(ahost, rport, locuser, remuser, cmd, fd2p) } lport--; if (fd2p == 0) { - write(s, "", 1); /* __write */ + __write(s, "", 1); lport = 0; } else { char num[8]; @@ -196,10 +196,10 @@ int rcmd(ahost, rport, locuser, remuser, cmd, fd2p) goto bad; listen(s2, 1); (void)snprintf(num, sizeof(num), "%d", lport); /* __snprintf */ - if (write(s, num, strlen(num)+1) != strlen(num)+1) { + if (__write(s, num, __strlen(num)+1) != __strlen(num)+1) { (void)fprintf(stderr, "rcmd: write (setting up stderr): %m\n"); - (void)close(s2); /* __close */ + (void)__close(s2); goto bad; } pfd[0].fd = s; @@ -210,11 +210,11 @@ int rcmd(ahost, rport, locuser, remuser, cmd, fd2p) (void)fprintf(stderr, "rcmd: poll (setting up stderr): %m\n"); else (void)fprintf(stderr, "poll: protocol failure in circuit setup\n"); - (void)close(s2); + (void)__close(s2); goto bad; } s3 = accept(s2, (struct sockaddr *)&from, &len); - (void)close(s2); + (void)__close(s2); if (s3 < 0) { (void)fprintf(stderr, "rcmd: accept: %m\n"); @@ -231,17 +231,17 @@ int rcmd(ahost, rport, locuser, remuser, cmd, fd2p) goto bad2; } } - (void)write(s, locuser, strlen(locuser)+1); - (void)write(s, remuser, strlen(remuser)+1); - (void)write(s, cmd, strlen(cmd)+1); - if (read(s, &c, 1) != 1) { + (void)__write(s, locuser, __strlen(locuser)+1); + (void)__write(s, remuser, __strlen(remuser)+1); + (void)__write(s, cmd, __strlen(cmd)+1); + if (__read(s, &c, 1) != 1) { (void)fprintf(stderr, "rcmd: %s: %m\n", *ahost); goto bad2; } if (c != 0) { - while (read(s, &c, 1) == 1) { - (void)write(STDERR_FILENO, &c, 1); + while (__read(s, &c, 1) == 1) { + (void)__write(STDERR_FILENO, &c, 1); if (c == '\n') break; } @@ -251,9 +251,9 @@ int rcmd(ahost, rport, locuser, remuser, cmd, fd2p) return s; bad2: if (lport) - (void)close(*fd2p); + (void)__close(*fd2p); bad: - (void)close(s); + (void)__close(s); sigsetmask(oldmask); return -1; } @@ -273,12 +273,12 @@ int rresvport(int *alport) if (bind(s, (struct sockaddr *)&sin, sizeof(sin)) >= 0) return s; if (errno != EADDRINUSE) { - (void)close(s); + (void)__close(s); return -1; } (*alport)--; if (*alport == IPPORT_RESERVED/2) { - (void)close(s); + (void)__close(s); __set_errno (EAGAIN); /* close */ return -1; } @@ -455,10 +455,10 @@ iruserok2 (raddr, superuser, ruser, luser, rhost) return -1; #endif - dirlen = strlen (pwd->pw_dir); + dirlen = __strlen (pwd->pw_dir); pbuf = malloc (dirlen + sizeof "/.rhosts"); - strcpy (pbuf, pwd->pw_dir); - strcat (pbuf, "/.rhosts"); + __strcpy (pbuf, pwd->pw_dir); + __strcat (pbuf, "/.rhosts"); /* Change effective uid while reading .rhosts. If root and reading an NFS mounted file system, can't read files that @@ -523,18 +523,18 @@ __icheckhost (u_int32_t raddr, char *lhost, const char *rhost) #ifdef HAVE_NETGROUP /* Check nis netgroup. */ - if (strncmp ("+@", lhost, 2) == 0) + if (__strncmp ("+@", lhost, 2) == 0) return innetgr (&lhost[2], rhost, NULL, NULL); - if (strncmp ("-@", lhost, 2) == 0) + if (__strncmp ("-@", lhost, 2) == 0) return -innetgr (&lhost[2], rhost, NULL, NULL); #endif /* HAVE_NETGROUP */ /* -host */ - if (strncmp ("-", lhost,1) == 0) { + if (__strncmp ("-", lhost,1) == 0) { negate = -1; lhost++; - } else if (strcmp ("+",lhost) == 0) { + } else if (__strcmp ("+",lhost) == 0) { return 1; /* asking for trouble, but ok.. */ } @@ -564,7 +564,7 @@ __icheckhost (u_int32_t raddr, char *lhost, const char *rhost) /* Spin through ip addresses. */ for (pp = hp->h_addr_list; *pp; ++pp) - if (!memcmp (&raddr, *pp, sizeof (u_int32_t))) + if (!__memcmp (&raddr, *pp, sizeof (u_int32_t))) return negate; /* No match. */ @@ -583,23 +583,23 @@ __icheckuser (const char *luser, const char *ruser) #ifdef HAVE_NETGROUP /* [-+]@netgroup */ - if (strncmp ("+@", luser, 2) == 0) + if (__strncmp ("+@", luser, 2) == 0) return innetgr (&luser[2], NULL, ruser, NULL); - if (strncmp ("-@", luser,2) == 0) + if (__strncmp ("-@", luser,2) == 0) return -innetgr (&luser[2], NULL, ruser, NULL); #endif /* HAVE_NETGROUP */ /* -user */ - if (strncmp ("-", luser, 1) == 0) - return -(strcmp (&luser[1], ruser) == 0); + if (__strncmp ("-", luser, 1) == 0) + return -(__strcmp (&luser[1], ruser) == 0); /* + */ - if (strcmp ("+", luser) == 0) + if (__strcmp ("+", luser) == 0) return 1; /* simple string match */ - return strcmp (ruser, luser) == 0; + return __strcmp (ruser, luser) == 0; } /* @@ -641,7 +641,7 @@ __ivaliduser2(hostf, raddr, luser, ruser, rhost) } /* Skip lines that are too long. */ - if (strchr (p, '\n') == NULL) { + if (__strchr (p, '\n') == NULL) { int ch = getc_unlocked (hostf); while (ch != '\n' && ch != EOF) diff --git a/libc/inet/rpc/rexec.c b/libc/inet/rpc/rexec.c index 2c280d922..00e68ff6b 100644 --- a/libc/inet/rpc/rexec.c +++ b/libc/inet/rpc/rexec.c @@ -70,7 +70,7 @@ rexec_af(ahost, rport, name, pass, cmd, fd2p, af) snprintf(servbuff, sizeof(servbuff), "%d", ntohs(rport)); servbuff[sizeof(servbuff) - 1] = '\0'; - memset(&hints, 0, sizeof(hints)); + __memset(&hints, 0, sizeof(hints)); hints.ai_family = af; hints.ai_socktype = SOCK_STREAM; hints.ai_flags = AI_CANONNAME; @@ -81,7 +81,7 @@ rexec_af(ahost, rport, name, pass, cmd, fd2p, af) } if (res0->ai_canonname){ - strncpy(ahostbuf, res0->ai_canonname, sizeof(ahostbuf)); + __strncpy(ahostbuf, res0->ai_canonname, sizeof(ahostbuf)); ahostbuf[sizeof(ahostbuf)-1] = '\0'; *ahost = ahostbuf; } @@ -97,7 +97,7 @@ retry: } if (connect(s, res0->ai_addr, res0->ai_addrlen) < 0) { if (errno == ECONNREFUSED && timo <= 16) { - (void) close(s); + (void) __close(s); sleep(timo); timo *= 2; goto retry; @@ -106,7 +106,7 @@ retry: return (-1); } if (fd2p == 0) { - (void) write(s, "", 1); + (void) __write(s, "", 1); port = 0; } else { char num[32]; @@ -114,18 +114,18 @@ retry: s2 = socket(res0->ai_family, res0->ai_socktype, 0); if (s2 < 0) { - (void) close(s); + (void) __close(s); return (-1); } listen(s2, 1); sa2len = sizeof (sa2); if (getsockname(s2, (struct sockaddr *)&sa2, &sa2len) < 0) { perror("getsockname"); - (void) close(s2); + (void) __close(s2); goto bad; } else if (sa2len != SA_LEN((struct sockaddr *)&sa2)) { __set_errno(EINVAL); - (void) close(s2); + (void) __close(s2); goto bad; } port = 0; @@ -134,10 +134,10 @@ retry: NI_NUMERICSERV)) port = atoi(servbuff); (void) sprintf(num, "%u", port); - (void) write(s, num, strlen(num)+1); + (void) __write(s, num, __strlen(num)+1); { socklen_t len = sizeof (from); s3 = accept(s2, (struct sockaddr *)&from, &len); - close(s2); + __close(s2); if (s3 < 0) { perror("accept"); port = 0; @@ -146,10 +146,10 @@ retry: } *fd2p = s3; } - (void) write(s, name, strlen(name) + 1); + (void) __write(s, name, __strlen(name) + 1); /* should public key encypt the password here */ - (void) write(s, pass, strlen(pass) + 1); - (void) write(s, cmd, strlen(cmd) + 1); + (void) __write(s, pass, __strlen(pass) + 1); + (void) __write(s, cmd, __strlen(cmd) + 1); /* We don't need the memory allocated for the name and the password in ruserpass anymore. */ @@ -158,13 +158,13 @@ retry: if (pass != orig_pass) free ((char *) pass); - if (read(s, &c, 1) != 1) { + if (__read(s, &c, 1) != 1) { perror(*ahost); goto bad; } if (c != 0) { - while (read(s, &c, 1) == 1) { - (void) write(2, &c, 1); + while (__read(s, &c, 1) == 1) { + (void) __write(2, &c, 1); if (c == '\n') break; } @@ -174,8 +174,8 @@ retry: return (s); bad: if (port) - (void) close(*fd2p); - (void) close(s); + (void) __close(*fd2p); + (void) __close(s); freeaddrinfo(res0); return (-1); } diff --git a/libc/inet/rpc/rpc_callmsg.c b/libc/inet/rpc/rpc_callmsg.c index 634b1bea5..8934eed91 100644 --- a/libc/inet/rpc/rpc_callmsg.c +++ b/libc/inet/rpc/rpc_callmsg.c @@ -85,7 +85,7 @@ xdr_callmsg (XDR *xdrs, struct rpc_msg *cmsg) IXDR_PUT_INT32 (buf, oa->oa_length); if (oa->oa_length) { - memcpy ((caddr_t) buf, oa->oa_base, oa->oa_length); + __memcpy ((caddr_t) buf, oa->oa_base, oa->oa_length); buf = (int32_t *) ((char *) buf + RNDUP (oa->oa_length)); } oa = &cmsg->rm_call.cb_verf; @@ -93,7 +93,7 @@ xdr_callmsg (XDR *xdrs, struct rpc_msg *cmsg) IXDR_PUT_INT32 (buf, oa->oa_length); if (oa->oa_length) { - memcpy ((caddr_t) buf, oa->oa_base, oa->oa_length); + __memcpy ((caddr_t) buf, oa->oa_base, oa->oa_length); /* no real need.... buf = (long *) ((char *) buf + RNDUP(oa->oa_length)); */ @@ -141,7 +141,7 @@ xdr_callmsg (XDR *xdrs, struct rpc_msg *cmsg) } else { - memcpy (oa->oa_base, (caddr_t) buf, oa->oa_length); + __memcpy (oa->oa_base, (caddr_t) buf, oa->oa_length); /* no real need.... buf = (long *) ((char *) buf + RNDUP(oa->oa_length)); @@ -181,7 +181,7 @@ xdr_callmsg (XDR *xdrs, struct rpc_msg *cmsg) } else { - memcpy (oa->oa_base, (caddr_t) buf, oa->oa_length); + __memcpy (oa->oa_base, (caddr_t) buf, oa->oa_length); /* no real need... buf = (long *) ((char *) buf + RNDUP(oa->oa_length)); diff --git a/libc/inet/rpc/rtime.c b/libc/inet/rpc/rtime.c index bf30cd282..554ad69eb 100644 --- a/libc/inet/rpc/rtime.c +++ b/libc/inet/rpc/rtime.c @@ -68,7 +68,7 @@ do_close (int s) int save; save = errno; - close (s); + __close (s); __set_errno (save); } @@ -132,7 +132,7 @@ rtime (struct sockaddr_in *addrp, struct rpc_timeval *timep, do_close (s); return -1; } - res = read (s, (char *) &thetime, sizeof (thetime)); + res = __read (s, (char *) &thetime, sizeof (thetime)); do_close (s); if (res < 0) return (-1); diff --git a/libc/inet/rpc/ruserpass.c b/libc/inet/rpc/ruserpass.c index 9963ac3e9..116a34276 100644 --- a/libc/inet/rpc/ruserpass.c +++ b/libc/inet/rpc/ruserpass.c @@ -112,9 +112,9 @@ int ruserpass(const char *host, const char **aname, const char **apass) return -1; } - buf = alloca (strlen(hdir) + 8); - strcpy(buf, hdir); - strcat(buf, "/.netrc"); + buf = alloca (__strlen(hdir) + 8); + __strcpy(buf, hdir); + __strcat(buf, "/.netrc"); cfile = fopen(buf, "r"); if (cfile == NULL) { if (errno != ENOENT) @@ -127,9 +127,9 @@ int ruserpass(const char *host, const char **aname, const char **apass) #endif if (gethostname(myname, sizeof(myname)) < 0) myname[0] = '\0'; - mydomain = strchr(myname, '.'); + mydomain = __strchr(myname, '.'); if (mydomain==NULL) { - mydomain=myname + strlen(myname); + mydomain=myname + __strlen(myname); } next: while ((t = token())) switch(t) { @@ -151,12 +151,12 @@ next: goto match; /* if (__strcasecmp(hostname, tokval) == 0) goto match; - if ((tmp = strchr(hostname, '.')) != NULL && + if ((tmp = __strchr(hostname, '.')) != NULL && __strcasecmp(tmp, mydomain) == 0 && __strncasecmp(hostname, tokval, tmp-hostname) == 0 && tokval[tmp - hostname] == '\0') goto match; */ - if ((tmp = strchr(host, '.')) != NULL && + if ((tmp = __strchr(host, '.')) != NULL && strcasecmp(tmp, mydomain) == 0 && strncasecmp(host, tokval, tmp - host) == 0 && tokval[tmp - host] == '\0') @@ -170,21 +170,21 @@ next: if (token()) { if (*aname == 0) { char *newp; - newp = malloc((unsigned) strlen(tokval) + 1); + newp = malloc((unsigned) __strlen(tokval) + 1); if (newp == NULL) { printf(_("out of memory")); goto bad; } - *aname = strcpy(newp, tokval); + *aname = __strcpy(newp, tokval); } else { - if (strcmp(*aname, tokval)) + if (__strcmp(*aname, tokval)) goto next; } } break; case PASSWD: - if (strcmp(*aname, "anonymous") && + if (__strcmp(*aname, "anonymous") && fstat(fileno(cfile), &stb) >= 0 && (stb.st_mode & 077) != 0) { printf(_("Error: .netrc file is readable by others.")); @@ -193,13 +193,13 @@ next: } if (token() && *apass == 0) { char *newp; - newp = malloc((unsigned) strlen(tokval) + 1); + newp = malloc((unsigned) __strlen(tokval) + 1); if (newp == NULL) { printf(_("out of memory")); goto bad; } - *apass = strcpy(newp, tokval); + *apass = __strcpy(newp, tokval); } break; case ACCOUNT: @@ -211,8 +211,8 @@ next: goto bad; } if (token() && *aacct == 0) { - *aacct = malloc((unsigned) strlen(tokval) + 1); - (void) strcpy(*aacct, tokval); + *aacct = malloc((unsigned) __strlen(tokval) + 1); + (void) __strcpy(*aacct, tokval); } #endif break; @@ -327,7 +327,7 @@ token() if (tokval[0] == 0) return (0); for (i = 0; i < (int) (sizeof (toktab) / sizeof (toktab[0])); ++i) - if (!strcmp(&tokstr[toktab[i].tokstr_off], tokval)) + if (!__strcmp(&tokstr[toktab[i].tokstr_off], tokval)) return toktab[i].tval; return (ID); } diff --git a/libc/inet/rpc/svc_auth_unix.c b/libc/inet/rpc/svc_auth_unix.c index 84c563cdf..256a42154 100644 --- a/libc/inet/rpc/svc_auth_unix.c +++ b/libc/inet/rpc/svc_auth_unix.c @@ -84,7 +84,7 @@ _svcauth_unix (struct svc_req *rqst, struct rpc_msg *msg) stat = AUTH_BADCRED; goto done; } - memcpy (aup->aup_machname, (caddr_t) buf, (u_int) str_len); + __memcpy (aup->aup_machname, (caddr_t) buf, (u_int) str_len); aup->aup_machname[str_len] = 0; str_len = RNDUP (str_len); buf = (int32_t *) ((char *) buf + str_len); diff --git a/libc/inet/rpc/svc_simple.c b/libc/inet/rpc/svc_simple.c index afc01bafa..da3c71211 100644 --- a/libc/inet/rpc/svc_simple.c +++ b/libc/inet/rpc/svc_simple.c @@ -96,7 +96,7 @@ registerrpc (u_long prognum, u_long versnum, u_long procnum, transp = svcudp_create (RPC_ANYSOCK); if (transp == NULL) { - buf = strdup (_("couldn't create an rpc server\n")); + buf = __strdup (_("couldn't create an rpc server\n")); goto err_out; } } @@ -111,7 +111,7 @@ registerrpc (u_long prognum, u_long versnum, u_long procnum, pl = (struct proglst_ *) malloc (sizeof (struct proglst_)); if (pl == NULL) { - buf = strdup (_("registerrpc: out of memory\n")); + buf = __strdup (_("registerrpc: out of memory\n")); goto err_out; } pl->p_progname = progname; @@ -150,7 +150,7 @@ universal (struct svc_req *rqstp, SVCXPRT *transp_l) { if (svc_sendreply (transp_l, (xdrproc_t)xdr_void, (char *) NULL) == FALSE) { - write (STDERR_FILENO, "xxx\n", 4); + __write (STDERR_FILENO, "xxx\n", 4); exit (1); } return; @@ -161,7 +161,7 @@ universal (struct svc_req *rqstp, SVCXPRT *transp_l) if (pl->p_prognum == prog && pl->p_procnum == proc) { /* decode arguments into a CLEAN buffer */ - memset (xdrbuf, 0, sizeof (xdrbuf)); /* required ! */ + __memset (xdrbuf, 0, sizeof (xdrbuf)); /* required ! */ if (!svc_getargs (transp_l, pl->p_inproc, xdrbuf)) { svcerr_decode (transp_l); diff --git a/libc/inet/rpc/svc_tcp.c b/libc/inet/rpc/svc_tcp.c index 05e1d2dbe..20deb8719 100644 --- a/libc/inet/rpc/svc_tcp.c +++ b/libc/inet/rpc/svc_tcp.c @@ -164,7 +164,7 @@ svctcp_create (int sock, u_int sendsize, u_int recvsize) } madesock = TRUE; } - memset ((char *) &addr, 0, sizeof (addr)); + __memset ((char *) &addr, 0, sizeof (addr)); addr.sin_family = AF_INET; if (bindresvport (sock, &addr)) { @@ -176,7 +176,7 @@ svctcp_create (int sock, u_int sendsize, u_int recvsize) { perror (_("svc_tcp.c - cannot getsockname or listen")); if (madesock) - (void) close (sock); + (void) __close (sock); return (SVCXPRT *) NULL; } r = (struct tcp_rendezvous *) mem_alloc (sizeof (*r)); @@ -272,7 +272,7 @@ again: * make a new transporter (re-uses xprt) */ xprt = makefd_xprt (sock, r->sendsize, r->recvsize); - memcpy (&xprt->xp_raddr, &addr, sizeof (addr)); + __memcpy (&xprt->xp_raddr, &addr, sizeof (addr)); xprt->xp_addrlen = len; return FALSE; /* there is never an rpc msg to be processed */ } @@ -289,7 +289,7 @@ svctcp_destroy (SVCXPRT *xprt) struct tcp_conn *cd = (struct tcp_conn *) xprt->xp_p1; xprt_unregister (xprt); - (void) close (xprt->xp_sock); + (void) __close (xprt->xp_sock); if (xprt->xp_port != 0) { /* a rendezvouser socket */ @@ -339,7 +339,7 @@ readtcp (char *xprtptr, char *buf, int len) } while ((pollfd.revents & POLLIN) == 0); - if ((len = read (sock, buf, len)) > 0) + if ((len = __read (sock, buf, len)) > 0) return len; fatal_err: @@ -359,7 +359,7 @@ writetcp (char *xprtptr, char * buf, int len) for (cnt = len; cnt > 0; cnt -= i, buf += i) { - if ((i = write (xprt->xp_sock, buf, cnt)) < 0) + if ((i = __write (xprt->xp_sock, buf, cnt)) < 0) { ((struct tcp_conn *) (xprt->xp_p1))->strm_stat = XPRT_DIED; return -1; diff --git a/libc/inet/rpc/svc_udp.c b/libc/inet/rpc/svc_udp.c index 88fde6c0f..a37552a4b 100644 --- a/libc/inet/rpc/svc_udp.c +++ b/libc/inet/rpc/svc_udp.c @@ -136,7 +136,7 @@ svcudp_bufcreate (sock, sendsz, recvsz) } madesock = TRUE; } - memset ((char *) &addr, 0, sizeof (addr)); + __memset ((char *) &addr, 0, sizeof (addr)); addr.sin_family = AF_INET; if (bindresvport (sock, &addr)) { @@ -147,7 +147,7 @@ svcudp_bufcreate (sock, sendsz, recvsz) { perror (_("svcudp_create - cannot getsockname")); if (madesock) - (void) close (sock); + (void) __close (sock); return (SVCXPRT *) NULL; } xprt = (SVCXPRT *) mem_alloc (sizeof (SVCXPRT)); @@ -200,7 +200,7 @@ svcudp_bufcreate (sock, sendsz, recvsz) #endif /* Clear the padding. */ pad = 0; - memset (&xprt->xp_pad [0], pad, sizeof (xprt->xp_pad)); + __memset (&xprt->xp_pad [0], pad, sizeof (xprt->xp_pad)); xprt_register (xprt); return xprt; @@ -375,7 +375,7 @@ svcudp_destroy (xprt) struct svcudp_data *su = su_data (xprt); xprt_unregister (xprt); - (void) close (xprt->xp_sock); + (void) __close (xprt->xp_sock); XDR_DESTROY (&(su->su_xdrs)); mem_free (rpc_buffer (xprt), su->su_iosz); mem_free ((caddr_t) su, sizeof (struct svcudp_data)); @@ -408,7 +408,7 @@ svcudp_destroy (xprt) (type *) mem_alloc((unsigned) (sizeof(type) * (size))) #define BZERO(addr, type, size) \ - memset((char *) addr, 0, sizeof(type) * (int) (size)) + __memset((char *) addr, 0, sizeof(type) * (int) (size)) /* * An entry in the cache @@ -586,7 +586,7 @@ cache_get (xprt, msg, replyp, replylenp) struct svcudp_data *su = su_data (xprt); struct udp_cache *uc = (struct udp_cache *) su->su_cache; -#define EQADDR(a1, a2) (memcmp((char*)&a1, (char*)&a2, sizeof(a1)) == 0) +#define EQADDR(a1, a2) (__memcmp((char*)&a1, (char*)&a2, sizeof(a1)) == 0) loc = CACHE_LOC (xprt, su->su_xid); for (ent = uc->uc_entries[loc]; ent != NULL; ent = ent->cache_next) @@ -609,6 +609,6 @@ cache_get (xprt, msg, replyp, replylenp) uc->uc_proc = msg->rm_call.cb_proc; uc->uc_vers = msg->rm_call.cb_vers; uc->uc_prog = msg->rm_call.cb_prog; - memcpy (&uc->uc_addr, &xprt->xp_raddr, sizeof (uc->uc_addr)); + __memcpy (&uc->uc_addr, &xprt->xp_raddr, sizeof (uc->uc_addr)); return 0; } diff --git a/libc/inet/rpc/svc_unix.c b/libc/inet/rpc/svc_unix.c index e3b3e8c11..d1568e4a7 100644 --- a/libc/inet/rpc/svc_unix.c +++ b/libc/inet/rpc/svc_unix.c @@ -158,10 +158,10 @@ svcunix_create (int sock, u_int sendsize, u_int recvsize, char *path) } madesock = TRUE; } - memset (&addr, '\0', sizeof (addr)); + __memset (&addr, '\0', sizeof (addr)); addr.sun_family = AF_UNIX; - len = strlen (path) + 1; - memcpy (addr.sun_path, path, len); + len = __strlen (path) + 1; + __memcpy (addr.sun_path, path, len); len += sizeof (addr.sun_family); bind (sock, (struct sockaddr *) &addr, len); @@ -171,7 +171,7 @@ svcunix_create (int sock, u_int sendsize, u_int recvsize, char *path) { perror (_("svc_unix.c - cannot getsockname or listen")); if (madesock) - close (sock); + __close (sock); return (SVCXPRT *) NULL; } @@ -268,10 +268,10 @@ again: /* * make a new transporter (re-uses xprt) */ - memset (&in_addr, '\0', sizeof (in_addr)); + __memset (&in_addr, '\0', sizeof (in_addr)); in_addr.sin_family = AF_UNIX; xprt = makefd_xprt (sock, r->sendsize, r->recvsize); - memcpy (&xprt->xp_raddr, &in_addr, sizeof (in_addr)); + __memcpy (&xprt->xp_raddr, &in_addr, sizeof (in_addr)); xprt->xp_addrlen = len; return FALSE; /* there is never an rpc msg to be processed */ } @@ -288,7 +288,7 @@ svcunix_destroy (SVCXPRT *xprt) struct unix_conn *cd = (struct unix_conn *) xprt->xp_p1; xprt_unregister (xprt); - close (xprt->xp_sock); + __close (xprt->xp_sock); if (xprt->xp_port != 0) { /* a rendezvouser socket */ @@ -380,7 +380,7 @@ __msgwrite (int sock, void *data, size_t cnt) cred.uid = geteuid (); cred.gid = getegid (); - memcpy (CMSG_DATA(cmsg), &cred, sizeof (struct ucred)); + __memcpy (CMSG_DATA(cmsg), &cred, sizeof (struct ucred)); cmsg->cmsg_level = SOL_SOCKET; cmsg->cmsg_type = SCM_CREDENTIALS; cmsg->cmsg_len = sizeof(*cmsg) + sizeof(struct ucred); diff --git a/libc/inet/rpc/xdr.c b/libc/inet/rpc/xdr.c index a1d449e19..7d69022dc 100644 --- a/libc/inet/rpc/xdr.c +++ b/libc/inet/rpc/xdr.c @@ -678,7 +678,7 @@ xdr_string (xdrs, cpp, maxsize) case XDR_ENCODE: if (sp == NULL) return FALSE; - size = strlen (sp); + size = __strlen (sp); break; case XDR_DECODE: break; diff --git a/libc/inet/rpc/xdr_array.c b/libc/inet/rpc/xdr_array.c index 450f5b2ea..584174e22 100644 --- a/libc/inet/rpc/xdr_array.c +++ b/libc/inet/rpc/xdr_array.c @@ -117,7 +117,7 @@ xdr_array (xdrs, addrp, sizep, maxsize, elsize, elproc) (void) fputs (_("xdr_array: out of memory\n"), stderr); return FALSE; } - memset (target, 0, nodesize); + __memset (target, 0, nodesize); break; case XDR_FREE: diff --git a/libc/inet/rpc/xdr_mem.c b/libc/inet/rpc/xdr_mem.c index e80de7b1a..568d0e54a 100644 --- a/libc/inet/rpc/xdr_mem.c +++ b/libc/inet/rpc/xdr_mem.c @@ -137,7 +137,7 @@ xdrmem_getbytes (XDR *xdrs, caddr_t addr, u_int len) { if ((xdrs->x_handy -= len) < 0) return FALSE; - memcpy (addr, xdrs->x_private, len); + __memcpy (addr, xdrs->x_private, len); xdrs->x_private += len; return TRUE; } @@ -151,7 +151,7 @@ xdrmem_putbytes (XDR *xdrs, const char *addr, u_int len) { if ((xdrs->x_handy -= len) < 0) return FALSE; - memcpy (xdrs->x_private, addr, len); + __memcpy (xdrs->x_private, addr, len); xdrs->x_private += len; return TRUE; } diff --git a/libc/inet/rpc/xdr_rec.c b/libc/inet/rpc/xdr_rec.c index abe81bb58..749955401 100644 --- a/libc/inet/rpc/xdr_rec.c +++ b/libc/inet/rpc/xdr_rec.c @@ -297,7 +297,7 @@ xdrrec_putbytes (XDR *xdrs, const char *addr, u_int len) { current = rstrm->out_boundry - rstrm->out_finger; current = (len < current) ? len : current; - memcpy (rstrm->out_finger, addr, current); + __memcpy (rstrm->out_finger, addr, current); rstrm->out_finger += current; addr += current; len -= current; @@ -599,7 +599,7 @@ get_input_bytes (RECSTREAM *rstrm, caddr_t addr, int len) continue; } current = (len < current) ? len : current; - memcpy (addr, rstrm->in_finger, current); + __memcpy (addr, rstrm->in_finger, current); rstrm->in_finger += current; addr += current; len -= current; diff --git a/libc/inet/rpc/xdr_reference.c b/libc/inet/rpc/xdr_reference.c index 1569e51b7..177c25059 100644 --- a/libc/inet/rpc/xdr_reference.c +++ b/libc/inet/rpc/xdr_reference.c @@ -95,7 +95,7 @@ xdr_reference (xdrs, pp, size, proc) (void) fputs (_("xdr_reference: out of memory\n"), stderr); return FALSE; } - memset (loc, 0, (int) size); + __memset (loc, 0, (int) size); break; default: break; |