summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--debian/ldconfig.128
-rw-r--r--debian/ldd.120
-rwxr-xr-xdebian/rules7
-rw-r--r--docs/uClibc_vs_SuSv3.txt3
-rw-r--r--docs/uclibc.org/news.html63
-rw-r--r--docs/uclibc.org/oldnews.html34
-rw-r--r--extra/Configs/Config.in9
-rw-r--r--ldso/ldso/x86_64/dl-startup.h6
-rw-r--r--libc/inet/rpc/clnt_generic.c29
-rw-r--r--libc/inet/rpc/getrpcent.c191
-rw-r--r--libc/inet/rpc/rcmd.c25
-rw-r--r--libc/stdlib/Makefile4
-rw-r--r--libc/string/wstring.c1
-rw-r--r--libc/sysdeps/linux/common/create_module.c2
-rw-r--r--libc/sysdeps/linux/powerpc/Makefile4
-rw-r--r--test/rpc/getrpcent_r.c3
-rw-r--r--utils/ldd.c2
17 files changed, 255 insertions, 176 deletions
diff --git a/debian/ldconfig.1 b/debian/ldconfig.1
deleted file mode 100644
index 2fb31b553..000000000
--- a/debian/ldconfig.1
+++ /dev/null
@@ -1,28 +0,0 @@
-.TH UCLIBC-GCC 1
-.SH NAME
-uclibc-gcc \- Cross-compiler for uClibc
-.SH SYNOPSIS
-.B uclibc-gcc
-[
-.B options
-]
-.br
-.B uclibc-ld
-[
-.B options
-]
-.SH DESCRIPTION
-These programs are wrappers for
-.B gcc
-and
-.B ld.
-.SH BUGS
-Probably.
-
-.SH AUTHORS
-Manuel Nova
-.br
-Manual page written by David Schleef <ds@schleef.org>
-.SH SEE ALSO
-.BR gcc (1),
-.BR ld (1)
diff --git a/debian/ldd.1 b/debian/ldd.1
deleted file mode 100644
index 6e391fca8..000000000
--- a/debian/ldd.1
+++ /dev/null
@@ -1,20 +0,0 @@
-.TH UCLIBC-LDD 1
-.SH NAME
-uclibc-ldd \- Print shared library dependencies
-.SH SYNOPSIS
-.B uclibc-ldd
-[
-.B options
-]
-.B file...
-.SH DESCRIPTION
-Prints shared library dependencies.
-.SH BUGS
-Maybe.
-
-.SH AUTHORS
-Erik Andersen <andersen@codepoet.org>
-.br
-Manual page written by David Schleef <ds@schleef.org>
-.SH SEE ALSO
-.BR ldd (1)
diff --git a/debian/rules b/debian/rules
index 93c5f9b53..73c69945a 100755
--- a/debian/rules
+++ b/debian/rules
@@ -133,10 +133,11 @@ install: build
$(MAKE) install install_utils PREFIX=`pwd`/debian/tmp
install -d debian/tmp/usr/share/man/man1
- install -m 644 debian/ldd.1 \
+ install -m 644 docs/man/ldd.1 \
debian/tmp/usr/share/man/man1/ldd.1
- install -m 644 debian/ldconfig.1 \
- debian/tmp/usr/share/man/man1/ldconfig.1
+ install -d debian/tmp/usr/share/man/man8
+ install -m 644 docs/man/ldconfig.8 \
+ debian/tmp/usr/share/man/man8/ldconfig.8
# Build architecture-independent files here.
diff --git a/docs/uClibc_vs_SuSv3.txt b/docs/uClibc_vs_SuSv3.txt
index 35c0ea9e2..b83f6d4ef 100644
--- a/docs/uClibc_vs_SuSv3.txt
+++ b/docs/uClibc_vs_SuSv3.txt
@@ -93,9 +93,8 @@ stropts.h: (depends on XSR) isastream, {g,s}et{,p}msg, fattach, fdetach
sys/mman.h: posix_madvice (depends on ADV); posix_mem_offset,
posix_typed_mem_getinfo, posix_typed_mem_open (depend on TYM);
shm_open, shm_unlink (depend on SHM)
-fcntl.h: posix_fadvice, posix_fallocate (depend on ADV)
+fcntl.h: posix_fallocate (depend on ADV)
signal.h: sigqueue (depends on RTS)
-stdlib.h: posix_memalign (depends on ADV)
Unimplemented mathematical interfaces:
diff --git a/docs/uclibc.org/news.html b/docs/uclibc.org/news.html
index d6eca9bef..d0a047efb 100644
--- a/docs/uclibc.org/news.html
+++ b/docs/uclibc.org/news.html
@@ -3,56 +3,49 @@
<ul>
- <li><b>13 January 2005 -- Bug and Patch Tracking</b><p>
+ <li> <b>17 August 2005, uClibc 0.9.28 Released</b>
+ <br>
- Bug reports sometimes get lost when posted to the mailing list. The
- developers of uClibc are busy people, and have only so much they can keep
- in their brains at a time. In my case, I'm lucky if I can remember my own
- name, much less a bug report posted last week... To prevent your bug report
- from getting lost, if you find a bug in uClibc, please use the
- <a href="http://bugs.uclibc.org/">shiny new Bug and Patch Tracking System</a>
- to post all the gory details.
+ CodePoet Consulting is pleased to announce the release of uClibc 0.9.28.
+ You are probably used to this by now, but this release is NOT binary
+ compatible with uClibc 0.9.27 or any earlier release, so be prepared to
+ recompile your software if you are still using an old version of uClibc.
<p>
- The same applies to patches... Regardless of whether your patch
- is a bug fix or adds spiffy new features, please post your patch
- to the Bug and Patch Tracking System to make certain it is
- properly considered.
-
+ Updated uClibc development systems built using uClibc 0.9.28, along
+ with the <a href="http://buildroot.uclibc.org/">uClibc buildroot</a>
+ and source code used to compile these development systems will be released
+ later this evening, along with
+ <a href="http://ltp.sourceforge.net/">Linux Test Project test suite</a>
+ results demonstrating how uClibc is doing. Contributions of LTP test
+ suite run results using uClibc are welcome...
<p>
- <li> <b>12 January 2005, uClibc 0.9.27 Released</b>
- <br>
- CodePoet Consulting is pleased to announce the release of
- uClibc 0.9.27. Release highlights include a new stdio core,
- Linux 2.6.x support, a much improved shared library loader,
- support for several new architectures, and of course fixes for
- the usual pile of bugs.
+ As usual the
+ <a href="http://www.uclibc.org/downloads/uClibc-0.9.28.tar.bz2">source code for this release</a>
+ is available <a href="http://www.uclibc.org/downloads/">here</a>.
- <p>
- Due primarily to the stdio changes, this release is NOT binary
- compatible with uClibc 0.9.26 or any earlier release, so be
- prepared to recompile your software if you are still using an
- old version of uClibc. Sorry for the pain...
<p>
+ <li><b>13 January 2005 -- Bug and Patch Tracking</b><p>
- Updated uClibc development systems using uClibc 0.9.27, along
- with the uClibc buildroot and source code used to compile these
- development systems, have also been released and are available
- from the uclibc.org downloads area.
+ Bug reports sometimes get lost when posted to the mailing list. The
+ developers of uClibc are busy people, and have only so much they can keep
+ in their brains at a time. In my case, I'm lucky if I can remember my own
+ name, much less a bug report posted last week... To prevent your bug report
+ from getting lost, if you find a bug in uClibc, please use the
+ <a href="http://bugs.uclibc.org/">shiny new Bug and Patch Tracking System</a>
+ to post all the gory details.
<p>
- As usual, the
- <a href="http://www.uclibc.org/downloads/Changelog">Changelog</a>,
- <a href="http://www.uclibc.org/downloads/Changelog.full">detailed changelog</a>,
- and <a href="http://www.uclibc.org/downloads/uClibc-0.9.27.tar.bz2">source code for this release</a>
- are available <a href="http://www.uclibc.org/downloads/">here</a>.
-
+ The same applies to patches... Regardless of whether your patch
+ is a bug fix or adds spiffy new features, please post your patch
+ to the Bug and Patch Tracking System to make certain it is
+ properly considered.
<p> <li> <b>Old News</b>
diff --git a/docs/uclibc.org/oldnews.html b/docs/uclibc.org/oldnews.html
index 06af6254c..655e291df 100644
--- a/docs/uclibc.org/oldnews.html
+++ b/docs/uclibc.org/oldnews.html
@@ -4,6 +4,40 @@
<ul>
+ <li> <b>12 January 2005, uClibc 0.9.27 Released</b>
+ <br>
+
+ CodePoet Consulting is pleased to announce the release of
+ uClibc 0.9.27. Release highlights include a new stdio core,
+ Linux 2.6.x support, a much improved shared library loader,
+ support for several new architectures, and of course fixes for
+ the usual pile of bugs.
+
+ <p>
+
+ Due primarily to the stdio changes, this release is NOT binary
+ compatible with uClibc 0.9.26 or any earlier release, so be
+ prepared to recompile your software if you are still using an
+ old version of uClibc. Sorry for the pain...
+
+ <p>
+
+ Updated uClibc development systems using uClibc 0.9.27, along
+ with the uClibc buildroot and source code used to compile these
+ development systems, have also been released and are available
+ from the uclibc.org downloads area.
+
+ <p>
+
+ As usual, the
+ <a href="http://www.uclibc.org/downloads/Changelog">Changelog</a>,
+ <a href="http://www.uclibc.org/downloads/Changelog.full">detailed changelog</a>,
+ and <a href="http://www.uclibc.org/downloads/uClibc-0.9.27.tar.bz2">source code for this release</a>
+ are available <a href="http://www.uclibc.org/downloads/">here</a>.
+
+
+
+ <p>
<li> <b>20 April 2004, uClibc 0.9.26 based Debian uwoody</b>
<br>
diff --git a/extra/Configs/Config.in b/extra/Configs/Config.in
index dbd6514b2..d0cf2da19 100644
--- a/extra/Configs/Config.in
+++ b/extra/Configs/Config.in
@@ -573,6 +573,15 @@ config UCLIBC_HAS_FULL_RPC
nfs mounts to work. If you find you need the rest of the RPC stuff,
then enable this option. Most people can safely answer N.
+config UCLIBC_HAS_REENTRANT_RPC
+ bool "Reentrant RPC support"
+ depends on UCLIBC_HAS_RPC
+ default y if !HAVE_SHARED
+ help
+ Most packages utilize the normal (non-reentrant) RPC functions, but
+ some (like exportfs from nfs-utils) need these reentrant versions.
+ Most people can safely answer N.
+
endmenu
diff --git a/ldso/ldso/x86_64/dl-startup.h b/ldso/ldso/x86_64/dl-startup.h
index eb2e0b7f4..94d7fd41e 100644
--- a/ldso/ldso/x86_64/dl-startup.h
+++ b/ldso/ldso/x86_64/dl-startup.h
@@ -42,10 +42,10 @@ asm(
/* Handle relocation of the symbols in the dynamic loader. */
static __always_inline
-void PERFORM_BOOTSTRAP_RELOC(ELF_RELOC *rpnt, unsigned long *reloc_addr,
- unsigned long symbol_addr, unsigned long load_addr, Elf64_Sym *sym)
+void PERFORM_BOOTSTRAP_RELOC(ELF_RELOC *rpnt, ElfW(Addr) *reloc_addr,
+ ElfW(Addr) symbol_addr, ElfW(Addr) load_addr, ElfW(Sym) *sym)
{
- switch (ELF64_R_TYPE(rpnt->r_info)) {
+ switch (ELF_R_TYPE(rpnt->r_info)) {
case R_X86_64_GLOB_DAT:
case R_X86_64_JUMP_SLOT:
*reloc_addr = symbol_addr + rpnt->r_addend;
diff --git a/libc/inet/rpc/clnt_generic.c b/libc/inet/rpc/clnt_generic.c
index 349c0f62d..c8fe545c3 100644
--- a/libc/inet/rpc/clnt_generic.c
+++ b/libc/inet/rpc/clnt_generic.c
@@ -53,7 +53,9 @@ clnt_create (const char *hostname, u_long prog, u_long vers,
struct hostent hostbuf, *h;
size_t hstbuflen;
char *hsttmpbuf;
- struct protoent *p;
+ struct protoent protobuf, *p;
+ size_t prtbuflen;
+ char *prttmpbuf;
struct sockaddr_in sin;
struct sockaddr_un sun;
int sock;
@@ -113,14 +115,23 @@ clnt_create (const char *hostname, u_long prog, u_long vers,
memset (sin.sin_zero, 0, sizeof (sin.sin_zero));
memcpy ((char *) &sin.sin_addr, h->h_addr, h->h_length);
-#warning getprotobyname is not reentrant... Add getprotobyname_r
- p = getprotobyname(proto);
- if (p == NULL) {
- struct rpc_createerr *ce = &get_rpc_createerr ();
- ce->cf_stat = RPC_UNKNOWNPROTO;
- ce->cf_error.re_errno = EPFNOSUPPORT;
- return NULL;
- }
+ prtbuflen = 1024;
+ prttmpbuf = alloca (prtbuflen);
+ while (getprotobyname_r (proto, &protobuf, prttmpbuf, prtbuflen, &p) != 0
+ || p == NULL)
+ if (errno != ERANGE)
+ {
+ struct rpc_createerr *ce = &get_rpc_createerr ();
+ ce->cf_stat = RPC_UNKNOWNPROTO;
+ ce->cf_error.re_errno = EPFNOSUPPORT;
+ return NULL;
+ }
+ else
+ {
+ /* Enlarge the buffer. */
+ prtbuflen *= 2;
+ prttmpbuf = alloca (prtbuflen);
+ }
sock = RPC_ANYSOCK;
switch (p->p_proto)
diff --git a/libc/inet/rpc/getrpcent.c b/libc/inet/rpc/getrpcent.c
index e290449c0..b796d856d 100644
--- a/libc/inet/rpc/getrpcent.c
+++ b/libc/inet/rpc/getrpcent.c
@@ -42,6 +42,7 @@
#include <netdb.h>
#include <sys/socket.h>
#include <arpa/inet.h>
+#include <errno.h>
/*
* Internet version.
@@ -58,46 +59,37 @@ static struct rpcdata {
char *domain;
} *rpcdata;
-static struct rpcent *interpret(const char *val, int len);
-
static char RPCDB[] = "/etc/rpc";
static struct rpcdata *_rpcdata(void)
{
register struct rpcdata *d = rpcdata;
- if (d == 0) {
+ if (d == NULL) {
d = (struct rpcdata *) calloc(1, sizeof(struct rpcdata));
rpcdata = d;
}
- return (d);
+ return d;
}
-struct rpcent *getrpcbynumber(number)
-register int number;
+struct rpcent *getrpcbynumber(register int number)
{
register struct rpcdata *d = _rpcdata();
- register struct rpcent *p;
+ register struct rpcent *rpc;
- if (d == 0)
- return (0);
+ if (d == NULL)
+ return NULL;
setrpcent(0);
- while ((p = getrpcent())) {
- if (p->r_number == number)
+ while ((rpc = getrpcent())) {
+ if (rpc->r_number == number)
break;
}
endrpcent();
- return (p);
+ return rpc;
}
-struct rpcent *
-#ifdef __linux__
-getrpcbyname(const char *name)
-#else
-getrpcbyname(name)
-char *name;
-#endif
+struct rpcent *getrpcbyname(const char *name)
{
struct rpcent *rpc;
char **rp;
@@ -105,25 +97,21 @@ char *name;
setrpcent(0);
while ((rpc = getrpcent())) {
if (strcmp(rpc->r_name, name) == 0)
- return (rpc);
+ return rpc;
for (rp = rpc->r_aliases; *rp != NULL; rp++) {
if (strcmp(*rp, name) == 0)
- return (rpc);
+ return rpc;
}
}
endrpcent();
- return (NULL);
+ return NULL;
}
-#ifdef __linux__
-void
-#endif
-setrpcent(f)
-int f;
+void setrpcent(int f)
{
register struct rpcdata *d = _rpcdata();
- if (d == 0)
+ if (d == NULL)
return;
if (d->rpcf == NULL)
d->rpcf = fopen(RPCDB, "r");
@@ -135,36 +123,42 @@ int f;
d->stayopen |= f;
}
-#ifdef __linux__
-void
-#endif
-endrpcent()
+void endrpcent()
{
register struct rpcdata *d = _rpcdata();
- if (d == 0)
+ if (d == NULL)
return;
- if (d->current && !d->stayopen) {
+ if (d->stayopen)
+ return;
+ if (d->current) {
free(d->current);
d->current = NULL;
}
- if (d->rpcf && !d->stayopen) {
+ if (d->rpcf) {
fclose(d->rpcf);
d->rpcf = NULL;
}
}
+static struct rpcent *interpret(struct rpcdata *);
+
+static struct rpcent *__get_next_rpcent(struct rpcdata *d)
+{
+ if (fgets(d->line, BUFSIZ, d->rpcf) == NULL)
+ return NULL;
+ return interpret(d);
+}
+
struct rpcent *getrpcent()
{
register struct rpcdata *d = _rpcdata();
- if (d == 0)
- return (NULL);
+ if (d == NULL)
+ return NULL;
if (d->rpcf == NULL && (d->rpcf = fopen(RPCDB, "r")) == NULL)
- return (NULL);
- if (fgets(d->line, BUFSIZ, d->rpcf) == NULL)
- return (NULL);
- return interpret(d->line, strlen(d->line));
+ return NULL;
+ return __get_next_rpcent(d);
}
#ifdef __linux__
@@ -184,37 +178,33 @@ static char *firstwhite(char *s)
}
#endif
-static struct rpcent *interpret(const char *val, int len)
+static struct rpcent *interpret(register struct rpcdata *d)
{
- register struct rpcdata *d = _rpcdata();
char *p;
register char *cp, **q;
- if (d == 0)
- return NULL;
- strncpy(d->line, val, len);
p = d->line;
- d->line[len] = '\n';
+ d->line[strlen(p)-1] = '\n';
if (*p == '#')
- return (getrpcent());
+ return __get_next_rpcent(d);
cp = index(p, '#');
if (cp == NULL) {
cp = index(p, '\n');
if (cp == NULL)
- return (getrpcent());
+ return __get_next_rpcent(d);
}
*cp = '\0';
#ifdef __linux__
if ((cp = firstwhite(p)))
*cp++ = 0;
else
- return (getrpcent());
+ return __get_next_rpcent(d);
#else
cp = index(p, ' ');
if (cp == NULL) {
cp = index(p, '\t');
if (cp == NULL)
- return (getrpcent());
+ return __get_next_rpcent(d);
}
*cp++ = '\0';
#endif
@@ -259,5 +249,102 @@ static struct rpcent *interpret(const char *val, int len)
#endif
}
*q = NULL;
- return (&d->rpc);
+ return &d->rpc;
+}
+
+#if defined(__UCLIBC_HAS_REENTRANT_RPC__)
+
+#if defined(__UCLIBC_HAS_THREADS__)
+# include <pthread.h>
+static pthread_mutex_t rpcdata_lock = PTHREAD_MUTEX_INITIALIZER;
+# define LOCK __pthread_mutex_lock(&rpcdata_lock)
+# define UNLOCK __pthread_mutex_unlock(&rpcdata_lock);
+#else
+# define LOCK
+# define UNLOCK
+#endif
+
+static int __copy_rpcent(struct rpcent *r, struct rpcent *result_buf, char *buffer,
+ size_t buflen, struct rpcent **result)
+{
+ size_t i, s;
+
+ *result = NULL;
+
+ if (!r)
+ return ENOENT;
+
+ /* copy the struct from the shared mem */
+ memset(result_buf, 0x00, sizeof(*result_buf));
+ memset(buffer, 0x00, buflen);
+
+ result_buf->r_number = r->r_number;
+
+ /* copy the aliases ... need to not only copy the alias strings,
+ * but the array of pointers to the alias strings */
+ i = 0;
+ while (r->r_aliases[i++]) ;
+
+ s = i-- * sizeof(char*);
+ if (buflen < s)
+ goto err_out;
+ result_buf->r_aliases = (char**)buffer;
+ buffer += s;
+ buflen -= s;
+
+ while (i-- > 0) {
+ 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);
+ }
+
+ /* copy the 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);
+
+ /* that was a hoot eh ? */
+ *result = result_buf;
+
+ return 0;
+err_out:
+ return ERANGE;
+}
+
+int getrpcbynumber_r(int number, struct rpcent *result_buf, char *buffer,
+ size_t buflen, struct rpcent **result)
+{
+ int ret;
+ LOCK;
+ ret = __copy_rpcent(getrpcbynumber(number), result_buf, buffer, buflen, result);
+ UNLOCK;
+ return ret;
+}
+
+int getrpcbyname_r(const char *name, struct rpcent *result_buf, char *buffer,
+ size_t buflen, struct rpcent **result)
+{
+ int ret;
+ LOCK;
+ ret = __copy_rpcent(getrpcbyname(name), result_buf, buffer, buflen, result);
+ UNLOCK;
+ return ret;
+}
+
+int getrpcent_r(struct rpcent *result_buf, char *buffer,
+ size_t buflen, struct rpcent **result)
+{
+ int ret;
+ LOCK;
+ ret = __copy_rpcent(getrpcent(), result_buf, buffer, buflen, result);
+ UNLOCK;
+ return ret;
}
+
+#endif /* __UCLIBC_HAS_REENTRANT_RPC__ */
diff --git a/libc/inet/rpc/rcmd.c b/libc/inet/rpc/rcmd.c
index cf839f4c6..af0e2e17a 100644
--- a/libc/inet/rpc/rcmd.c
+++ b/libc/inet/rpc/rcmd.c
@@ -57,11 +57,6 @@ static char sccsid[] = "@(#)rcmd.c 8.3 (Berkeley) 3/26/94";
#include <netinet/in.h>
#include <arpa/inet.h>
-#ifdef __UCLIBC_HAS_THREADS__
-#undef __UCLIBC_HAS_THREADS__
-#warning FIXME I am not reentrant yet...
-#endif
-
/* some forward declarations */
static int __ivaliduser2(FILE *hostf, u_int32_t raddr,
@@ -76,13 +71,13 @@ int rcmd(ahost, rport, locuser, remuser, cmd, fd2p)
const char *locuser, *remuser, *cmd;
int *fd2p;
{
-#ifdef __UCLIBC_HAS_THREADS__
+#ifdef __UCLIBC_HAS_REENTRANT_RPC__
int herr;
- struct hostent hostbuf;
+ struct hostent hostbuf;
size_t hstbuflen;
char *tmphstbuf;
#endif
- struct hostent *hp;
+ struct hostent *hp;
struct sockaddr_in sin, from;
struct pollfd pfd[2];
int32_t oldmask;
@@ -92,7 +87,7 @@ int rcmd(ahost, rport, locuser, remuser, cmd, fd2p)
pid = getpid();
-#ifdef __UCLIBC_HAS_THREADS__
+#ifdef __UCLIBC_HAS_REENTRANT_RPC__
hstbuflen = 1024;
#ifdef __ARCH_HAS_MMU__
tmphstbuf = alloca (hstbuflen);
@@ -299,14 +294,14 @@ int ruserok(rhost, superuser, ruser, luser)
struct hostent *hp;
u_int32_t addr;
char **ap;
-#ifdef __UCLIBC_HAS_THREADS__
+#ifdef __UCLIBC_HAS_REENTRANT_RPC__
size_t buflen;
char *buffer;
int herr;
struct hostent hostbuf;
#endif
-#ifdef __UCLIBC_HAS_THREADS__
+#ifdef __UCLIBC_HAS_REENTRANT_RPC__
buflen = 1024;
#ifdef __ARCH_HAS_MMU__
buffer = alloca (buflen);
@@ -432,7 +427,7 @@ iruserok2 (raddr, superuser, ruser, luser, rhost)
size_t dirlen;
uid_t uid;
-#ifdef __UCLIBC_HAS_THREADS__
+#ifdef __UCLIBC_HAS_REENTRANT_RPC__
size_t buflen = sysconf (_SC_GETPW_R_SIZE_MAX);
struct passwd pwdbuf;
#ifdef __ARCH_HAS_MMU__
@@ -515,7 +510,7 @@ __icheckhost (u_int32_t raddr, char *lhost, const char *rhost)
int negate=1; /* Multiply return with this to get -1 instead of 1 */
char **pp;
-#ifdef __UCLIBC_HAS_THREADS__
+#ifdef __UCLIBC_HAS_REENTRANT_RPC__
int save_errno;
size_t buflen;
char *buffer;
@@ -545,7 +540,7 @@ __icheckhost (u_int32_t raddr, char *lhost, const char *rhost)
return negate * (! (raddr ^ laddr));
/* Better be a hostname. */
-#ifdef __UCLIBC_HAS_THREADS__
+#ifdef __UCLIBC_HAS_REENTRANT_RPC__
buflen = 1024;
buffer = malloc(buflen);
save_errno = errno;
@@ -559,7 +554,7 @@ __icheckhost (u_int32_t raddr, char *lhost, const char *rhost)
__set_errno (save_errno);
#else
hp = gethostbyname(lhost);
-#endif /* __UCLIBC_HAS_THREADS__ */
+#endif /* __UCLIBC_HAS_REENTRANT_RPC__ */
if (hp == NULL)
return 0;
diff --git a/libc/stdlib/Makefile b/libc/stdlib/Makefile
index 5a3ffe631..40d03521f 100644
--- a/libc/stdlib/Makefile
+++ b/libc/stdlib/Makefile
@@ -1,7 +1,7 @@
# Makefile for uClibc
#
# Copyright (C) 2000 by Lineo, inc.
-# Copyright (C) 2000,2001 Erik Andersen <andersen@uclibc.org>
+# Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org>
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU Library General Public License as published by the Free
@@ -86,7 +86,7 @@ CSRC = abort.c getenv.c mkdtemp.c mktemp.c realpath.c mkstemp.c mkstemp64.c \
getpt.c ptsname.c grantpt.c unlockpt.c gcvt.c drand48-iter.c jrand48.c \
jrand48_r.c lrand48.c lrand48_r.c mrand48.c mrand48_r.c nrand48.c \
nrand48_r.c rand_r.c srand48.c srand48_r.c seed48.c seed48_r.c \
- valloc.c
+ valloc.c posix_memalign.c
ifeq ($(UCLIBC_HAS_FLOATS),y)
CSRC += drand48.c drand48_r.c erand48.c erand48_r.c
endif
diff --git a/libc/string/wstring.c b/libc/string/wstring.c
index acf1a2b0a..6f54ae615 100644
--- a/libc/string/wstring.c
+++ b/libc/string/wstring.c
@@ -1572,7 +1572,6 @@ int __xpg_strerror_r(int errnum, char *strerrbuf, size_t buflen)
#ifdef L___glibc_strerror_r
weak_alias(__glibc_strerror_r,__strerror_r);
-weak_alias(__glibc_strerror_r,_glibc_strerror_r); /* for 0.9.27 compat ... remove after 0.9.28 */
char *__glibc_strerror_r(int errnum, char *strerrbuf, size_t buflen)
{
diff --git a/libc/sysdeps/linux/common/create_module.c b/libc/sysdeps/linux/common/create_module.c
index e1a4cfb04..e37f8e804 100644
--- a/libc/sysdeps/linux/common/create_module.c
+++ b/libc/sysdeps/linux/common/create_module.c
@@ -31,7 +31,7 @@
#ifdef __NR_create_module
-#if defined(__i386__) || defined(__m68k__) || defined(__arm__) || defined(__cris__) || defined(__i960__)
+#if defined(__i386__) || defined(__m68k__) || defined(__arm__) || defined(__thumb__) || defined(__cris__) || defined(__i960__)
#define __NR___create_module __NR_create_module
#ifdef __STR_NR_create_module
#define __STR_NR___create_module __STR_NR_create_module
diff --git a/libc/sysdeps/linux/powerpc/Makefile b/libc/sysdeps/linux/powerpc/Makefile
index eb212bac0..4c345c00f 100644
--- a/libc/sysdeps/linux/powerpc/Makefile
+++ b/libc/sysdeps/linux/powerpc/Makefile
@@ -25,10 +25,10 @@ SCRT_OBJ = $(patsubst %,S%, $(CRT_OBJ))
CTOR_TARGETS=$(TOPDIR)lib/crti.o $(TOPDIR)lib/crtn.o
SSRC=__longjmp.S setjmp.S bsd-setjmp.S bsd-_setjmp.S brk.S \
- clone.S __uClibc_syscall.S syscall.S
+ clone.S __uClibc_syscall.S syscall.S vfork.S
SOBJS=$(patsubst %.S,%.o, $(SSRC))
-CSRC=mmap.c vfork.c __syscall_error.c pread_write.c ioctl.c
+CSRC=mmap.c __syscall_error.c pread_write.c ioctl.c
COBJS=$(patsubst %.c,%.o, $(CSRC))
OBJS=$(SOBJS) $(COBJS)
diff --git a/test/rpc/getrpcent_r.c b/test/rpc/getrpcent_r.c
index 29cd5c278..708deba10 100644
--- a/test/rpc/getrpcent_r.c
+++ b/test/rpc/getrpcent_r.c
@@ -5,9 +5,8 @@
int main(int argc, char *argv[])
{
int ret;
- char rpcdata[10024];
+ char rpcdata[1024];
struct rpcent rpcbuf, *ent;
-memset(rpcdata, 0x00, sizeof(rpcdata));
while ((ret = getrpcent_r(&rpcbuf, rpcdata, sizeof(rpcdata), &ent)) == 0) {
printf("%s: %i", ent->r_name, ent->r_number);
diff --git a/utils/ldd.c b/utils/ldd.c
index a4877e31a..0dc12ad01 100644
--- a/utils/ldd.c
+++ b/utils/ldd.c
@@ -51,7 +51,7 @@
#include <dmalloc.h>
#endif
-#if defined(__arm__)
+#if defined(__arm__) || defined(__thumb__)
#define MATCH_MACHINE(x) (x == EM_ARM)
#define ELFCLASSM ELFCLASS32
#endif