Fix config parser and netdb

2010-10-13 Thread Natanael Copa
Hi, Here are a set of patches which should be applied upon the 3 previous ones i sent to list. Those patches fixes getserv{ent,byname,byport}, getnet{ent,byname,byaddr} and getproto{ent,byname,bynumber} funcs to properly handle long lines. Rather than try dynamically reallocate the buffer it

[PATCH 1/4] parse_config: discard rest of incomplete line

2010-10-13 Thread Natanael Copa
If line is longer then size of given buffer and buffer is not allocated by the config parser itself, then discard rest of line. --- libc/misc/internals/parse_config.c |7 +++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/libc/misc/internals/parse_config.c

[PATCH 2/4] getservice: fix handling of long lines

2010-10-13 Thread Natanael Copa
Don't try to be smart by dynamically realloc buffersize as it doesn't work. Instead, be simple and allocate a buffer big enough. This fixes a memory leak when calling getserv{ent,byname,byport} multiple times. To save memory we reduce number of max aliases. We seldomly will need more than 1

[PATCH 4/4] getproto: increase line buffer size, simlify and fix alias handling

2010-10-13 Thread Natanael Copa
We increase line buffer size, reduce MAXALIASES and make sure we don't segfault when there are too manuy aliases in /etc/protocols. --- libc/inet/getproto.c | 25 - 1 files changed, 8 insertions(+), 17 deletions(-) diff --git a/libc/inet/getproto.c

Re: __thread fastpath not being taken

2010-10-13 Thread Chris Metcalf
In my email quoted below, I found that __tls_get_addr() under the uClibc version we were running with was always running the slow path. We were running an old version from the nptl branch, back at change 22990 on svn. Since then, I've ported glibc-2.11.2 to tile. I looked at the performance of

Re: Problems with pthreads in a chroot?

2010-10-13 Thread Richard Braun
On Wed, Oct 13, 2010 at 10:45:18PM +0100, Ed W wrote: I traced the workaround to either disabling PAX_MPROTECT in the host kernel, or calling paxctl -m on the test binary (was expecting to need it on the library instead?) Can anyone shed some light on why creating a pthread (old linux