From jocke at uclibc.org Mon Apr 2 04:10:23 2007 From: jocke at uclibc.org (jocke at uclibc.org) Date: Mon, 2 Apr 2007 04:10:23 -0700 (PDT) Subject: svn commit: trunk/uClibc/libm/powerpc/classic Message-ID: <20070402111023.0743248023@busybox.net> Author: jocke Date: 2007-04-02 04:10:22 -0700 (Mon, 02 Apr 2007) New Revision: 18300 Log: Fix fallout from the e500 math integration. from Steve Papacharalambous. Modified: trunk/uClibc/libm/powerpc/classic/s_copysign.c Changeset: Modified: trunk/uClibc/libm/powerpc/classic/s_copysign.c =================================================================== --- trunk/uClibc/libm/powerpc/classic/s_copysign.c 2007-04-02 06:17:45 UTC (rev 18299) +++ trunk/uClibc/libm/powerpc/classic/s_copysign.c 2007-04-02 11:10:22 UTC (rev 18300) @@ -23,7 +23,7 @@ *******************************************************************************/ #include -#include "../fp_private.h" +#include "../../fp_private.h" /******************************************************************************* * * From vapier at uclibc.org Mon Apr 2 05:06:00 2007 From: vapier at uclibc.org (vapier at uclibc.org) Date: Mon, 2 Apr 2007 05:06:00 -0700 (PDT) Subject: svn commit: trunk/uClibc/libc/stdlib: malloc malloc-simple malloc-standard Message-ID: <20070402120600.F3B6A48016@busybox.net> Author: vapier Date: 2007-04-02 05:06:00 -0700 (Mon, 02 Apr 2007) New Revision: 18301 Log: POSIX requires that errno be set whenever 0 is returned by malloc() Modified: trunk/uClibc/libc/stdlib/malloc-simple/alloc.c trunk/uClibc/libc/stdlib/malloc-standard/malloc.c trunk/uClibc/libc/stdlib/malloc/malloc.c Changeset: Modified: trunk/uClibc/libc/stdlib/malloc/malloc.c =================================================================== --- trunk/uClibc/libc/stdlib/malloc/malloc.c 2007-04-02 11:10:22 UTC (rev 18300) +++ trunk/uClibc/libc/stdlib/malloc/malloc.c 2007-04-02 12:06:00 UTC (rev 18301) @@ -200,7 +200,7 @@ #else /* Some programs will call malloc (0). Lets be strict and return NULL */ if (unlikely (size == 0)) - return 0; + goto oom; #endif /* Check if they are doing something dumb like malloc(-1) */ Modified: trunk/uClibc/libc/stdlib/malloc-simple/alloc.c =================================================================== --- trunk/uClibc/libc/stdlib/malloc-simple/alloc.c 2007-04-02 11:10:22 UTC (rev 18300) +++ trunk/uClibc/libc/stdlib/malloc-simple/alloc.c 2007-04-02 12:06:00 UTC (rev 18301) @@ -32,7 +32,8 @@ size++; #else /* Some programs will call malloc (0). Lets be strict and return NULL */ - return 0; + __set_errno(ENOMEM); + return NULL; #endif } Modified: trunk/uClibc/libc/stdlib/malloc-standard/malloc.c =================================================================== --- trunk/uClibc/libc/stdlib/malloc-standard/malloc.c 2007-04-02 11:10:22 UTC (rev 18300) +++ trunk/uClibc/libc/stdlib/malloc-standard/malloc.c 2007-04-02 12:06:00 UTC (rev 18301) @@ -826,7 +826,10 @@ void * retval; #if !defined(__MALLOC_GLIBC_COMPAT__) - if (!bytes) return NULL; + if (!bytes) { + __set_errno(ENOMEM); + return NULL; + } #endif __MALLOC_LOCK; From vapier at uclibc.org Mon Apr 2 12:30:59 2007 From: vapier at uclibc.org (vapier at uclibc.org) Date: Mon, 2 Apr 2007 12:30:59 -0700 (PDT) Subject: svn commit: trunk/uClibc/libc/sysdeps/linux/sh/sys Message-ID: <20070402193059.501D948023@busybox.net> Author: vapier Date: 2007-04-02 12:30:58 -0700 (Mon, 02 Apr 2007) New Revision: 18308 Log: fixes from Carmelo AMOROSO to depend less on kernel headers Modified: trunk/uClibc/libc/sysdeps/linux/sh/sys/procfs.h Changeset: Modified: trunk/uClibc/libc/sysdeps/linux/sh/sys/procfs.h =================================================================== --- trunk/uClibc/libc/sysdeps/linux/sh/sys/procfs.h 2007-04-02 17:01:22 UTC (rev 18307) +++ trunk/uClibc/libc/sysdeps/linux/sh/sys/procfs.h 2007-04-02 19:30:58 UTC (rev 18308) @@ -29,10 +29,19 @@ #include #include #include -#include __BEGIN_DECLS +/* + * ELF register definitions... + */ +typedef unsigned long elf_greg_t; + +#define ELF_NGREG (sizeof (struct pt_regs) / sizeof(elf_greg_t)) +typedef elf_greg_t elf_gregset_t[ELF_NGREG]; + +typedef struct user_fpu_struct elf_fpregset_t; + struct elf_siginfo { int si_signo; /* Signal number. */ From bugs at busybox.net Mon Apr 2 12:37:52 2007 From: bugs at busybox.net (bugs at busybox.net) Date: Mon, 2 Apr 2007 12:37:52 -0700 Subject: [uClibc 0001253]: [PATCH] clean up some warnings in libm found when building on ia64 Message-ID: <6552c54521abd8a73b97db69e62e8d01@busybox.net> The following issue has been CLOSED ====================================================================== http://busybox.net/bugs/view.php?id=1253 ====================================================================== Reported By: ahs3 Assigned To: uClibc ====================================================================== Project: uClibc Issue ID: 1253 Category: Math Library Reproducibility: always Severity: minor Priority: normal Status: closed Resolution: won't fix Fixed in Version: ====================================================================== Date Submitted: 03-02-2007 15:06 PST Last Modified: 04-02-2007 12:37 PDT ====================================================================== Summary: [PATCH] clean up some warnings in libm found when building on ia64 Description: Several files in libm had compilation warnings -- specifically, e_pow.c, s_ceil.c, s_floor.c, s_ldexp.c and s_modf.c. In all cases, local variable names were shadowing global variable names. This is _not_ a big deal; personally, I prefer to have no compiler warnings, if at all possible. So, variable names were changed slightly to remove the warnings. Not knowing enough about the history of these files, they may be desirable as is; this patch is not required for functionality or correctness -- it only makes the GCC warnings go away. ====================================================================== ---------------------------------------------------------------------- vapier - 04-02-07 12:37 ---------------------------------------------------------------------- as noted on mailing list, we try to stay as close to glibc as possible, including these annoying shadows ;( Issue History Date Modified Username Field Change ====================================================================== 03-02-07 15:06 ahs3 New Issue 03-02-07 15:06 ahs3 Status new => assigned 03-02-07 15:06 ahs3 Assigned To => uClibc 03-02-07 15:06 ahs3 File Added: libm-warnings.patch 04-02-07 12:37 vapier Note Added: 0002292 04-02-07 12:37 vapier Status assigned => closed 04-02-07 12:37 vapier Resolution open => won't fix ====================================================================== From vapier at uclibc.org Mon Apr 2 13:52:19 2007 From: vapier at uclibc.org (vapier at uclibc.org) Date: Mon, 2 Apr 2007 13:52:19 -0700 (PDT) Subject: svn commit: trunk/uClibc/libm Message-ID: <20070402205219.7D32848022@busybox.net> Author: vapier Date: 2007-04-02 13:52:18 -0700 (Mon, 02 Apr 2007) New Revision: 18309 Log: implement carg Added: trunk/uClibc/libm/carg.c Modified: trunk/uClibc/libm/Makefile.in trunk/uClibc/libm/float_wrappers.c Changeset: Modified: trunk/uClibc/libm/Makefile.in =================================================================== --- trunk/uClibc/libm/Makefile.in 2007-04-02 19:30:58 UTC (rev 18308) +++ trunk/uClibc/libm/Makefile.in 2007-04-02 20:52:18 UTC (rev 18309) @@ -72,7 +72,7 @@ w_cosh.c w_drem.c w_exp.c w_fmod.c w_gamma.c w_gamma_r.c \ w_hypot.c w_j0.c w_j1.c w_jn.c w_lgamma.c w_lgamma_r.c \ w_log.c w_log10.c w_pow.c w_remainder.c w_scalb.c w_sinh.c \ - w_sqrt.c fpmacros.c nan.c + w_sqrt.c fpmacros.c nan.c carg.c FL_MOBJ := \ acosf.o acoshf.o asinf.o asinhf.o atan2f.o atanf.o atanhf.o cbrtf.o \ ceilf.o copysignf.o cosf.o coshf.o erfcf.o erff.o exp2f.o expf.o \ @@ -81,7 +81,7 @@ log1pf.o log2f.o logbf.o logf.o lrintf.o lroundf.o modff.o nearbyintf.o \ nextafterf.o powf.o remainderf.o remquof.o rintf.o roundf.o \ scalblnf.o scalbnf.o sinf.o sinhf.o sqrtf.o tanf.o tanhf.o \ - tgammaf.o truncf.o + tgammaf.o truncf.o cargf.o else # This list of math functions was taken from POSIX/IEEE 1003.1b-1993 libm_CSRC := \ Added: trunk/uClibc/libm/carg.c =================================================================== --- trunk/uClibc/libm/carg.c (rev 0) +++ trunk/uClibc/libm/carg.c 2007-04-02 20:52:18 UTC (rev 18309) @@ -0,0 +1,33 @@ +/* Compute argument of complex double value. + Copyright (C) 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper , 1997. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +#include +#include + +libm_hidden_proto(atan2) +libm_hidden_proto(carg) + +double +carg (__complex__ double x) +{ + return atan2 (__imag__ x, __real__ x); +} + +libm_hidden_def(carg) Modified: trunk/uClibc/libm/float_wrappers.c =================================================================== --- trunk/uClibc/libm/float_wrappers.c 2007-04-02 19:30:58 UTC (rev 18308) +++ trunk/uClibc/libm/float_wrappers.c 2007-04-02 20:52:18 UTC (rev 18309) @@ -10,7 +10,8 @@ * GNU Lesser General Public License version 2.1 or later. */ -#include "math.h" +#include +#include /* For the time being, do _NOT_ implement these functions * that are defined by SuSv3 */ @@ -138,6 +139,15 @@ #endif +#ifdef L_cargf +libm_hidden_proto(carg) +float cargf (float complex x) +{ + return (float) carg( (double)x ); +} +#endif + + #ifdef L_cbrtf libm_hidden_proto(cbrt) float cbrtf (float x) From vapier at uclibc.org Mon Apr 2 18:03:43 2007 From: vapier at uclibc.org (vapier at uclibc.org) Date: Mon, 2 Apr 2007 18:03:43 -0700 (PDT) Subject: svn commit: trunk/uClibc/libm Message-ID: <20070403010343.59EEA48021@busybox.net> Author: vapier Date: 2007-04-02 18:03:42 -0700 (Mon, 02 Apr 2007) New Revision: 18310 Log: import llrint() from glibc Added: trunk/uClibc/libm/s_llrint.c Modified: trunk/uClibc/libm/Makefile.in Changeset: Modified: trunk/uClibc/libm/Makefile.in =================================================================== --- trunk/uClibc/libm/Makefile.in 2007-04-02 20:52:18 UTC (rev 18309) +++ trunk/uClibc/libm/Makefile.in 2007-04-03 01:03:42 UTC (rev 18310) @@ -72,7 +72,7 @@ w_cosh.c w_drem.c w_exp.c w_fmod.c w_gamma.c w_gamma_r.c \ w_hypot.c w_j0.c w_j1.c w_jn.c w_lgamma.c w_lgamma_r.c \ w_log.c w_log10.c w_pow.c w_remainder.c w_scalb.c w_sinh.c \ - w_sqrt.c fpmacros.c nan.c carg.c + w_sqrt.c fpmacros.c nan.c carg.c s_llrint.c FL_MOBJ := \ acosf.o acoshf.o asinf.o asinhf.o atan2f.o atanf.o atanhf.o cbrtf.o \ ceilf.o copysignf.o cosf.o coshf.o erfcf.o erff.o exp2f.o expf.o \ Added: trunk/uClibc/libm/s_llrint.c =================================================================== --- trunk/uClibc/libm/s_llrint.c (rev 0) +++ trunk/uClibc/libm/s_llrint.c 2007-04-03 01:03:42 UTC (rev 18310) @@ -0,0 +1,93 @@ +/* Round argument to nearest integral value according to current rounding + direction. + Copyright (C) 1997, 2004, 2006 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper , 1997. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +#include + +#include "math_private.h" + +static const double two52[2] = +{ + 4.50359962737049600000e+15, /* 0x43300000, 0x00000000 */ + -4.50359962737049600000e+15, /* 0xC3300000, 0x00000000 */ +}; + + +long long int +__llrint (double x) +{ + int32_t j0; + u_int32_t i1, i0; + long long int result; + volatile double w; + double t; + int sx; + + EXTRACT_WORDS (i0, i1, x); + j0 = ((i0 >> 20) & 0x7ff) - 0x3ff; + sx = i0 >> 31; + i0 &= 0xfffff; + i0 |= 0x100000; + + if (j0 < 20) + { + w = two52[sx] + x; + t = w - two52[sx]; + EXTRACT_WORDS (i0, i1, t); + j0 = ((i0 >> 20) & 0x7ff) - 0x3ff; + i0 &= 0xfffff; + i0 |= 0x100000; + + result = (j0 < 0 ? 0 : i0 >> (20 - j0)); + } + else if (j0 < (int32_t) (8 * sizeof (long long int)) - 1) + { + if (j0 >= 52) + result = (((long long int) i0 << 32) | i1) << (j0 - 52); + else + { + w = two52[sx] + x; + t = w - two52[sx]; + EXTRACT_WORDS (i0, i1, t); + j0 = ((i0 >> 20) & 0x7ff) - 0x3ff; + i0 &= 0xfffff; + i0 |= 0x100000; + + if (j0 == 20) + result = (long long int) i0; + else + result = ((long long int) i0 << (j0 - 20)) | (i1 >> (52 - j0)); + } + } + else + { + /* The number is too large. It is left implementation defined + what happens. */ + return (long long int) x; + } + + return sx ? -result : result; +} + +weak_alias (__llrint, llrint) +#ifdef NO_LONG_DOUBLE +strong_alias (__llrint, __llrintl) +weak_alias (__llrint, llrintl) +#endif From bugs at busybox.net Thu Apr 5 01:47:51 2007 From: bugs at busybox.net (bugs at busybox.net) Date: Thu, 5 Apr 2007 01:47:51 -0700 Subject: [uClibc 0001303]: mmap: unsigned shift operation => overflow error Message-ID: The following issue has been SUBMITTED. ====================================================================== http://busybox.net/bugs/view.php?id=1303 ====================================================================== Reported By: anlo Assigned To: uClibc ====================================================================== Project: uClibc Issue ID: 1303 Category: Architecture Specific Reproducibility: always Severity: major Priority: normal Status: assigned ====================================================================== Date Submitted: 04-05-2007 01:47 PDT Last Modified: 04-05-2007 01:47 PDT ====================================================================== Summary: mmap: unsigned shift operation => overflow error Description: Product version: 0.9.29 (2007-04-02) When trying to map /dev/mem with offset 0xFFFFF000 on the ARM platform, mmap returns -EOVERFLOW. After some investigation, I have found the cause in uClibc/libc/sysdeps/linux/arm/mmap.c: Since off_t is defined as a long int and the sign bit is set in the address, the shift operation at line 45 (see below) shifts in ones instead of zeroes from the left. This results the offset sent to the kernel function becomes 0xFFFFFFFF instead of 0x000FFFFF with MMAP2_PAGE_SHIFT set to 12. (off_t) (offset >> MMAP2_PAGE_SHIFT) Proposed change, since the kernel function (do_mmap) expects offset as unsigned long: ((unsigned long) offset >> MMAP2_PAGE_SHIFT) ====================================================================== Issue History Date Modified Username Field Change ====================================================================== 04-05-07 01:47 anlo New Issue 04-05-07 01:47 anlo Status new => assigned 04-05-07 01:47 anlo Assigned To => uClibc ====================================================================== From bugs at busybox.net Sun Apr 8 23:52:17 2007 From: bugs at busybox.net (bugs at busybox.net) Date: Sun, 8 Apr 2007 23:52:17 -0700 Subject: [uClibc 0001307]: Makefile compatibility to Mac OS X Message-ID: <6648d50ebe50a4de0ba517e5620cfdc8@busybox.net> The following issue has been SUBMITTED. ====================================================================== http://busybox.net/bugs/view.php?id=1307 ====================================================================== Reported By: rreilink Assigned To: uClibc ====================================================================== Project: uClibc Issue ID: 1307 Category: Other Reproducibility: have not tried Severity: minor Priority: normal Status: assigned ====================================================================== Date Submitted: 04-08-2007 23:52 PDT Last Modified: 04-08-2007 23:52 PDT ====================================================================== Summary: Makefile compatibility to Mac OS X Description: In order to get uClibC to compile/install properly on Mac OS X, the following changes in the Makefile are required: Line 231 & 241: change sed -e 's/lib\///' to sed -e 's/lib\/*//' This is because find lib/ makes the results start with a / , which causes the symlinks to point to /libc.0.so instead of libc.0.so Line 258: change cp -dRf to -PRf because the cp on Mac OS X doesn't support the -d flag. Note that this has been changed from -PRf to -dRf for busybox compatibility. ucLibC version: 0.9.28.3 toolchain: powerpc-gekko-linux-uclibc host platform: OS X 10.4 (Darwin 8.9.1 i386) ====================================================================== Issue History Date Modified Username Field Change ====================================================================== 04-08-07 23:52 rreilink New Issue 04-08-07 23:52 rreilink Status new => assigned 04-08-07 23:52 rreilink Assigned To => uClibc ====================================================================== From vapier at uclibc.org Wed Apr 11 15:52:22 2007 From: vapier at uclibc.org (vapier at uclibc.org) Date: Wed, 11 Apr 2007 15:52:22 -0700 (PDT) Subject: svn commit: trunk/uClibc/libc/stdlib/malloc-simple Message-ID: <20070411225222.6753A485BF@busybox.net> Author: vapier Date: 2007-04-11 15:52:20 -0700 (Wed, 11 Apr 2007) New Revision: 18406 Log: POSIX says you can use realloc() to shrink buffers ... make sure we dont trigger a buffer overflow in that case Modified: trunk/uClibc/libc/stdlib/malloc-simple/alloc.c Changeset: Modified: trunk/uClibc/libc/stdlib/malloc-simple/alloc.c =================================================================== --- trunk/uClibc/libc/stdlib/malloc-simple/alloc.c 2007-04-11 20:43:31 UTC (rev 18405) +++ trunk/uClibc/libc/stdlib/malloc-simple/alloc.c 2007-04-11 22:52:20 UTC (rev 18406) @@ -91,7 +91,8 @@ newptr = malloc(size); if (newptr) { - memcpy(newptr, ptr, *((size_t *) (ptr - sizeof(size_t)))); + size_t old_size = *((size_t *) (ptr - sizeof(size_t))); + memcpy(newptr, ptr, (old_size < size ? old_size : size)); free(ptr); } return newptr; From vapier at uclibc.org Wed Apr 11 15:53:54 2007 From: vapier at uclibc.org (vapier at uclibc.org) Date: Wed, 11 Apr 2007 15:53:54 -0700 (PDT) Subject: svn commit: trunk/uClibc/test/malloc Message-ID: <20070411225354.B9C47485B9@busybox.net> Author: vapier Date: 2007-04-11 15:53:54 -0700 (Wed, 11 Apr 2007) New Revision: 18407 Log: test case to make sure realloc() can shrink buffers properly Added: trunk/uClibc/test/malloc/realloc-can-shrink.c Changeset: Added: trunk/uClibc/test/malloc/realloc-can-shrink.c =================================================================== --- trunk/uClibc/test/malloc/realloc-can-shrink.c (rev 0) +++ trunk/uClibc/test/malloc/realloc-can-shrink.c 2007-04-11 22:53:54 UTC (rev 18407) @@ -0,0 +1,17 @@ +/* make sure that realloc() can properly shrink buffers */ + +#include + +#define LARGE_BUFFER (1 << 20) /* idea is to span a lot of pages */ + +int main() +{ + int count = 20; + char *ptr = NULL; + while (count--) { + ptr = realloc(ptr, LARGE_BUFFER); + ptr = realloc(ptr, 1); + } + free(ptr); + return 0; +} From vapier at uclibc.org Wed Apr 11 20:41:17 2007 From: vapier at uclibc.org (vapier at uclibc.org) Date: Wed, 11 Apr 2007 20:41:17 -0700 (PDT) Subject: svn commit: trunk/uClibc/libm Message-ID: <20070412034117.7E774485B8@busybox.net> Author: vapier Date: 2007-04-11 20:41:16 -0700 (Wed, 11 Apr 2007) New Revision: 18411 Log: remove __* symbols and enable llrintf() Modified: trunk/uClibc/libm/Makefile.in trunk/uClibc/libm/float_wrappers.c trunk/uClibc/libm/s_llrint.c Changeset: Modified: trunk/uClibc/libm/Makefile.in =================================================================== --- trunk/uClibc/libm/Makefile.in 2007-04-12 01:56:19 UTC (rev 18410) +++ trunk/uClibc/libm/Makefile.in 2007-04-12 03:41:16 UTC (rev 18411) @@ -81,7 +81,7 @@ log1pf.o log2f.o logbf.o logf.o lrintf.o lroundf.o modff.o nearbyintf.o \ nextafterf.o powf.o remainderf.o remquof.o rintf.o roundf.o \ scalblnf.o scalbnf.o sinf.o sinhf.o sqrtf.o tanf.o tanhf.o \ - tgammaf.o truncf.o cargf.o + tgammaf.o truncf.o cargf.o llrintf.o else # This list of math functions was taken from POSIX/IEEE 1003.1b-1993 libm_CSRC := \ Modified: trunk/uClibc/libm/float_wrappers.c =================================================================== --- trunk/uClibc/libm/float_wrappers.c 2007-04-12 01:56:19 UTC (rev 18410) +++ trunk/uClibc/libm/float_wrappers.c 2007-04-12 03:41:16 UTC (rev 18411) @@ -20,7 +20,6 @@ #undef L_fmaf /*float fmaf(float, float, float);*/ #undef L_fmaxf /*float fmaxf(float, float);*/ #undef L_fminf /*float fminf(float, float);*/ -#undef L_llrintf /*long long llrintf(float);*/ #undef L_log2f /*float log2f(float);*/ #undef L_nearbyintf /*float nearbyintf(float);*/ #undef L_nexttowardf /*float nexttowardf(float, long double);*/ Modified: trunk/uClibc/libm/s_llrint.c =================================================================== --- trunk/uClibc/libm/s_llrint.c 2007-04-12 01:56:19 UTC (rev 18410) +++ trunk/uClibc/libm/s_llrint.c 2007-04-12 03:41:16 UTC (rev 18411) @@ -29,9 +29,10 @@ -4.50359962737049600000e+15, /* 0xC3300000, 0x00000000 */ }; +libm_hidden_proto(llrint) long long int -__llrint (double x) +llrint (double x) { int32_t j0; u_int32_t i1, i0; @@ -86,8 +87,4 @@ return sx ? -result : result; } -weak_alias (__llrint, llrint) -#ifdef NO_LONG_DOUBLE -strong_alias (__llrint, __llrintl) -weak_alias (__llrint, llrintl) -#endif +libm_hidden_def(llrint) From bugs at busybox.net Thu Apr 12 11:22:45 2007 From: bugs at busybox.net (bugs at busybox.net) Date: Thu, 12 Apr 2007 11:22:45 -0700 Subject: [buildroot 0001310]: __progname = 0 Message-ID: <3e9acbc022b51ffc908fa9007d3287f7@bugs.uclibc.org> A NOTE has been added to this issue. ====================================================================== http://busybox.net/bugs/view.php?id=1310 ====================================================================== Reported By: letshriramin Assigned To: uClibc ====================================================================== Project: buildroot Issue ID: 1310 Category: Architecture Specific Reproducibility: always Severity: minor Priority: normal Status: assigned ====================================================================== Date Submitted: 04-12-2007 07:19 PDT Last Modified: 04-12-2007 11:22 PDT ====================================================================== Summary: __progname = 0 Description: When main is started __progname = 0 which causes sshd/ssh like programs which use _progname to core dump Tested for powerpc architecture - gcc3.4.6 & gcc4.1.2 It may be due to the aliasing __progname & uclibc_progname with uclibc version 0.9.29 ====================================================================== ---------------------------------------------------------------------- bernhardf - 04-12-07 10:08 ---------------------------------------------------------------------- not a buildroot issue. Check your uClibc config, perhaps ---------------------------------------------------------------------- letshriramin - 04-12-07 11:22 ---------------------------------------------------------------------- Snippet of uclibc config file related to this -------------------------------------------------------- #UCLIBC_HAS_PROGRAM_INVOCATION_NAME is not set UCLIBC_HAS___PROGNAME=y -------------------------------------------------------- Issue History Date Modified Username Field Change ====================================================================== 04-12-07 07:19 letshriramin New Issue 04-12-07 07:19 letshriramin Status new => assigned 04-12-07 07:19 letshriramin Assigned To => buildroot 04-12-07 10:08 bernhardf Note Added: 0002307 04-12-07 10:08 bernhardf Assigned To buildroot => uClibc 04-12-07 11:22 letshriramin Note Added: 0002308 ====================================================================== From pkj at uclibc.org Fri Apr 13 01:32:20 2007 From: pkj at uclibc.org (pkj at uclibc.org) Date: Fri, 13 Apr 2007 01:32:20 -0700 (PDT) Subject: svn commit: trunk/uClibc: extra/Configs libc/pwd_grp libc/unistd Message-ID: <20070413083220.9830348086@busybox.net> Author: pkj Date: 2007-04-13 01:32:18 -0700 (Fri, 13 Apr 2007) New Revision: 18424 Log: Patch by Ricard Wanderlof : * Add configurable buffer sizes for getpwnam() and getgrnam(). The default buffer size is, as before, 256 (glibc seems to use 1024 by default). Modified: trunk/uClibc/extra/Configs/Config.in trunk/uClibc/libc/pwd_grp/pwd_grp.c trunk/uClibc/libc/unistd/sysconf.c Changeset: Modified: trunk/uClibc/extra/Configs/Config.in =================================================================== --- trunk/uClibc/extra/Configs/Config.in 2007-04-13 02:43:28 UTC (rev 18423) +++ trunk/uClibc/extra/Configs/Config.in 2007-04-13 08:32:18 UTC (rev 18424) @@ -596,6 +596,30 @@ endmenu +menu "Advanced Library Settings" + +config UCLIBC_PWD_BUFFER_SIZE + int "Buffer size for getpwnam() and friends" + default 256 + range 256 1024 + help + This sets the value of the buffer size for getpwnam() and friends. + By default, this is 256. (For reference, glibc uses 1024). + The value can be found using sysconf() with the _SC_GETPW_R_SIZE_MAX + parameter. + +config UCLIBC_GRP_BUFFER_SIZE + int "Buffer size for getgrnam() and friends" + default 256 + range 256 1024 + help + This sets the value of the buffer size for getgrnam() and friends. + By default, this is 256. (For reference, glibc uses 1024). + The value can be found using sysconf() with the _SC_GETGR_R_SIZE_MAX + parameter. + +endmenu + menu "Networking Support" config UCLIBC_HAS_IPV6 Modified: trunk/uClibc/libc/pwd_grp/pwd_grp.c =================================================================== --- trunk/uClibc/libc/pwd_grp/pwd_grp.c 2007-04-13 02:43:28 UTC (rev 18423) +++ trunk/uClibc/libc/pwd_grp/pwd_grp.c 2007-04-13 08:32:18 UTC (rev 18424) @@ -55,14 +55,6 @@ #endif /**********************************************************************/ -/* Sizes for statically allocated buffers. */ - -/* If you change these values, also change _SC_GETPW_R_SIZE_MAX and - * _SC_GETGR_R_SIZE_MAX in libc/unistd/sysconf.c to match */ -#define PWD_BUFFER_SIZE 256 -#define GRP_BUFFER_SIZE 256 - -/**********************************************************************/ /* Prototypes for internal functions. */ extern int __parsepwent(void *pw, char *line) attribute_hidden; @@ -165,7 +157,7 @@ struct passwd *fgetpwent(FILE *stream) { - static char buffer[PWD_BUFFER_SIZE]; + static char buffer[__UCLIBC_PWD_BUFFER_SIZE__]; static struct passwd resultbuf; struct passwd *result; @@ -183,7 +175,7 @@ struct group *fgetgrent(FILE *stream) { - static char buffer[GRP_BUFFER_SIZE]; + static char buffer[__UCLIBC_GRP_BUFFER_SIZE__]; static struct group resultbuf; struct group *result; @@ -200,7 +192,7 @@ struct spwd *fgetspent(FILE *stream) { - static char buffer[PWD_BUFFER_SIZE]; + static char buffer[__UCLIBC_PWD_BUFFER_SIZE__]; static struct spwd resultbuf; struct spwd *result; @@ -220,7 +212,7 @@ *result = NULL; - if (buflen < PWD_BUFFER_SIZE) { + if (buflen < __UCLIBC_PWD_BUFFER_SIZE__) { DO_ERANGE: __set_errno(rv); goto DONE; @@ -306,7 +298,7 @@ struct passwd *getpwuid(uid_t uid) { - static char buffer[PWD_BUFFER_SIZE]; + static char buffer[__UCLIBC_PWD_BUFFER_SIZE__]; static struct passwd resultbuf; struct passwd *result; @@ -322,7 +314,7 @@ struct group *getgrgid(gid_t gid) { - static char buffer[GRP_BUFFER_SIZE]; + static char buffer[__UCLIBC_GRP_BUFFER_SIZE__]; static struct group resultbuf; struct group *result; @@ -348,7 +340,7 @@ int rv; struct passwd *pp; struct passwd password; - char pwd_buff[PWD_BUFFER_SIZE]; + char pwd_buff[__UCLIBC_PWD_BUFFER_SIZE__]; *result = NULL; if (!(rv = getpwuid_r(uid, &password, pwd_buff, sizeof(pwd_buff), &pp))) { @@ -369,7 +361,7 @@ struct spwd *getspuid(uid_t uid) { - static char buffer[PWD_BUFFER_SIZE]; + static char buffer[__UCLIBC_PWD_BUFFER_SIZE__]; static struct spwd resultbuf; struct spwd *result; @@ -385,7 +377,7 @@ struct passwd *getpwnam(const char *name) { - static char buffer[PWD_BUFFER_SIZE]; + static char buffer[__UCLIBC_PWD_BUFFER_SIZE__]; static struct passwd resultbuf; struct passwd *result; @@ -401,7 +393,7 @@ struct group *getgrnam(const char *name) { - static char buffer[GRP_BUFFER_SIZE]; + static char buffer[__UCLIBC_GRP_BUFFER_SIZE__]; static struct group resultbuf; struct group *result; @@ -417,7 +409,7 @@ struct spwd *getspnam(const char *name) { - static char buffer[PWD_BUFFER_SIZE]; + static char buffer[__UCLIBC_PWD_BUFFER_SIZE__]; static struct spwd resultbuf; struct spwd *result; @@ -435,7 +427,7 @@ { struct passwd resultbuf; struct passwd *result; - char buffer[PWD_BUFFER_SIZE]; + char buffer[__UCLIBC_PWD_BUFFER_SIZE__]; if (!buf) { __set_errno(EINVAL); @@ -634,7 +626,7 @@ struct passwd *getpwent(void) { - static char line_buff[PWD_BUFFER_SIZE]; + static char line_buff[__UCLIBC_PWD_BUFFER_SIZE__]; static struct passwd pwd; struct passwd *result; @@ -650,7 +642,7 @@ struct group *getgrent(void) { - static char line_buff[GRP_BUFFER_SIZE]; + static char line_buff[__UCLIBC_GRP_BUFFER_SIZE__]; static struct group gr; struct group *result; @@ -666,7 +658,7 @@ struct spwd *getspent(void) { - static char line_buff[PWD_BUFFER_SIZE]; + static char line_buff[__UCLIBC_PWD_BUFFER_SIZE__]; static struct spwd spwd; struct spwd *result; @@ -682,7 +674,7 @@ struct spwd *sgetspent(const char *string) { - static char line_buff[PWD_BUFFER_SIZE]; + static char line_buff[__UCLIBC_PWD_BUFFER_SIZE__]; static struct spwd spwd; struct spwd *result; @@ -705,7 +697,7 @@ int num_groups, rv; char **m; struct group group; - char buff[PWD_BUFFER_SIZE]; + char buff[__UCLIBC_PWD_BUFFER_SIZE__]; rv = -1; @@ -1134,7 +1126,7 @@ int rv = ERANGE; __STDIO_AUTO_THREADLOCK_VAR; - if (buflen < PWD_BUFFER_SIZE) { + if (buflen < __UCLIBC_PWD_BUFFER_SIZE__) { __set_errno(rv); } else { __STDIO_AUTO_THREADLOCK(f); Modified: trunk/uClibc/libc/unistd/sysconf.c =================================================================== --- trunk/uClibc/libc/unistd/sysconf.c 2007-04-13 02:43:28 UTC (rev 18423) +++ trunk/uClibc/libc/unistd/sysconf.c 2007-04-13 08:32:18 UTC (rev 18424) @@ -568,13 +568,11 @@ #endif /* If you change these, also change libc/pwd_grp/pwd_grp.c to match */ -#define PWD_BUFFER_SIZE 256 -#define GRP_BUFFER_SIZE 256 case _SC_GETGR_R_SIZE_MAX: - return GRP_BUFFER_SIZE; + return __UCLIBC_GRP_BUFFER_SIZE__; case _SC_GETPW_R_SIZE_MAX: - return PWD_BUFFER_SIZE; + return __UCLIBC_PWD_BUFFER_SIZE__; /* getlogin() is a worthless interface. In uClibc we let the user specify * whatever they want via the LOGNAME environment variable, or we return NULL From vapier at uclibc.org Fri Apr 13 11:01:21 2007 From: vapier at uclibc.org (vapier at uclibc.org) Date: Fri, 13 Apr 2007 11:01:21 -0700 (PDT) Subject: svn commit: trunk/uClibc/libc/stdlib/malloc Message-ID: <20070413180121.6071E4855D@busybox.net> Author: vapier Date: 2007-04-13 11:01:21 -0700 (Fri, 13 Apr 2007) New Revision: 18427 Log: fix up malloc debug building Modified: trunk/uClibc/libc/stdlib/malloc/free.c trunk/uClibc/libc/stdlib/malloc/heap.h trunk/uClibc/libc/stdlib/malloc/heap_alloc.c trunk/uClibc/libc/stdlib/malloc/heap_alloc_at.c trunk/uClibc/libc/stdlib/malloc/heap_debug.c trunk/uClibc/libc/stdlib/malloc/heap_free.c trunk/uClibc/libc/stdlib/malloc/malloc.c trunk/uClibc/libc/stdlib/malloc/malloc.h trunk/uClibc/libc/stdlib/malloc/malloc_debug.c trunk/uClibc/libc/stdlib/malloc/realloc.c Changeset: Modified: trunk/uClibc/libc/stdlib/malloc/free.c =================================================================== --- trunk/uClibc/libc/stdlib/malloc/free.c 2007-04-13 16:32:26 UTC (rev 18426) +++ trunk/uClibc/libc/stdlib/malloc/free.c 2007-04-13 18:01:21 UTC (rev 18427) @@ -7,7 +7,7 @@ * This file is subject to the terms and conditions of the GNU Lesser * General Public License. See the file COPYING.LIB in the main * directory of this archive for more details. - * + * * Written by Miles Bader */ Modified: trunk/uClibc/libc/stdlib/malloc/heap.h =================================================================== --- trunk/uClibc/libc/stdlib/malloc/heap.h 2007-04-13 16:32:26 UTC (rev 18426) +++ trunk/uClibc/libc/stdlib/malloc/heap.h 2007-04-13 18:01:21 UTC (rev 18427) @@ -7,7 +7,7 @@ * This file is subject to the terms and conditions of the GNU Lesser * General Public License. See the file COPYING.LIB in the main * directory of this archive for more details. - * + * * Written by Miles Bader */ Modified: trunk/uClibc/libc/stdlib/malloc/heap_alloc.c =================================================================== --- trunk/uClibc/libc/stdlib/malloc/heap_alloc.c 2007-04-13 16:32:26 UTC (rev 18426) +++ trunk/uClibc/libc/stdlib/malloc/heap_alloc.c 2007-04-13 18:01:21 UTC (rev 18427) @@ -7,7 +7,7 @@ * This file is subject to the terms and conditions of the GNU Lesser * General Public License. See the file COPYING.LIB in the main * directory of this archive for more details. - * + * * Written by Miles Bader */ Modified: trunk/uClibc/libc/stdlib/malloc/heap_alloc_at.c =================================================================== --- trunk/uClibc/libc/stdlib/malloc/heap_alloc_at.c 2007-04-13 16:32:26 UTC (rev 18426) +++ trunk/uClibc/libc/stdlib/malloc/heap_alloc_at.c 2007-04-13 18:01:21 UTC (rev 18427) @@ -7,7 +7,7 @@ * This file is subject to the terms and conditions of the GNU Lesser * General Public License. See the file COPYING.LIB in the main * directory of this archive for more details. - * + * * Written by Miles Bader */ Modified: trunk/uClibc/libc/stdlib/malloc/heap_debug.c =================================================================== --- trunk/uClibc/libc/stdlib/malloc/heap_debug.c 2007-04-13 16:32:26 UTC (rev 18426) +++ trunk/uClibc/libc/stdlib/malloc/heap_debug.c 2007-04-13 18:01:21 UTC (rev 18427) @@ -7,7 +7,7 @@ * This file is subject to the terms and conditions of the GNU Lesser * General Public License. See the file COPYING.LIB in the main * directory of this archive for more details. - * + * * Written by Miles Bader */ @@ -15,9 +15,11 @@ #include #include #include +#include libc_hidden_proto(vfprintf) libc_hidden_proto(fprintf) +libc_hidden_proto(_exit) #include "malloc.h" #include "heap.h" @@ -66,7 +68,7 @@ /* Output an error message to stderr, and exit. STR is printed with the failure message. */ -static void +static void attribute_noreturn __heap_check_failure (struct heap *heap, struct heap_free_area *fa, const char *str, char *fmt, ...) { @@ -81,13 +83,13 @@ vfprintf (stderr, fmt, val); va_end (val); - __putc ('\n', stderr); + fprintf (stderr, "\n"); __malloc_debug_set_indent (0); __malloc_debug_printf (1, "heap dump:"); __heap_dump_freelist (heap); - __exit (22); + _exit (22); } /* Do some consistency checks on HEAP. If they fail, output an error Modified: trunk/uClibc/libc/stdlib/malloc/heap_free.c =================================================================== --- trunk/uClibc/libc/stdlib/malloc/heap_free.c 2007-04-13 16:32:26 UTC (rev 18426) +++ trunk/uClibc/libc/stdlib/malloc/heap_free.c 2007-04-13 18:01:21 UTC (rev 18427) @@ -7,7 +7,7 @@ * This file is subject to the terms and conditions of the GNU Lesser * General Public License. See the file COPYING.LIB in the main * directory of this archive for more details. - * + * * Written by Miles Bader */ Modified: trunk/uClibc/libc/stdlib/malloc/malloc.c =================================================================== --- trunk/uClibc/libc/stdlib/malloc/malloc.c 2007-04-13 16:32:26 UTC (rev 18426) +++ trunk/uClibc/libc/stdlib/malloc/malloc.c 2007-04-13 18:01:21 UTC (rev 18427) @@ -7,7 +7,7 @@ * This file is subject to the terms and conditions of the GNU Lesser * General Public License. See the file COPYING.LIB in the main * directory of this archive for more details. - * + * * Written by Miles Bader */ Modified: trunk/uClibc/libc/stdlib/malloc/malloc.h =================================================================== --- trunk/uClibc/libc/stdlib/malloc/malloc.h 2007-04-13 16:32:26 UTC (rev 18426) +++ trunk/uClibc/libc/stdlib/malloc/malloc.h 2007-04-13 18:01:21 UTC (rev 18427) @@ -84,7 +84,6 @@ to stderr, when the variable __malloc_mmb_debug is set to true. */ #ifdef MALLOC_MMB_DEBUGGING # include -extern int __putc(int c, FILE *stream) attribute_hidden; extern int __malloc_mmb_debug; # define MALLOC_MMB_DEBUG(indent, fmt, args...) \ Modified: trunk/uClibc/libc/stdlib/malloc/malloc_debug.c =================================================================== --- trunk/uClibc/libc/stdlib/malloc/malloc_debug.c 2007-04-13 16:32:26 UTC (rev 18426) +++ trunk/uClibc/libc/stdlib/malloc/malloc_debug.c 2007-04-13 18:01:21 UTC (rev 18427) @@ -7,7 +7,7 @@ * This file is subject to the terms and conditions of the GNU Lesser * General Public License. See the file COPYING.LIB in the main * directory of this archive for more details. - * + * * Written by Miles Bader */ Modified: trunk/uClibc/libc/stdlib/malloc/realloc.c =================================================================== --- trunk/uClibc/libc/stdlib/malloc/realloc.c 2007-04-13 16:32:26 UTC (rev 18426) +++ trunk/uClibc/libc/stdlib/malloc/realloc.c 2007-04-13 18:01:21 UTC (rev 18427) @@ -7,7 +7,7 @@ * This file is subject to the terms and conditions of the GNU Lesser * General Public License. See the file COPYING.LIB in the main * directory of this archive for more details. - * + * * Written by Miles Bader */ From aldot at uclibc.org Sat Apr 14 10:03:20 2007 From: aldot at uclibc.org (aldot at uclibc.org) Date: Sat, 14 Apr 2007 10:03:20 -0700 (PDT) Subject: svn commit: trunk/uClibc/libc/stdio Message-ID: <20070414170320.5E17F4855E@busybox.net> Author: aldot Date: 2007-04-14 10:03:18 -0700 (Sat, 14 Apr 2007) New Revision: 18441 Log: - dtrt Modified: trunk/uClibc/libc/stdio/fputc.c Changeset: Modified: trunk/uClibc/libc/stdio/fputc.c =================================================================== --- trunk/uClibc/libc/stdio/fputc.c 2007-04-14 15:08:41 UTC (rev 18440) +++ trunk/uClibc/libc/stdio/fputc.c 2007-04-14 17:03:18 UTC (rev 18441) @@ -72,9 +72,11 @@ } libc_hidden_def(__fputc_unlocked) -libc_hidden_proto(fputc_unlocked) +/* exposing these would be fundamentally *wrong*! fix you, instead! */ +/* libc_hidden_proto(fputc_unlocked) */ strong_alias(__fputc_unlocked,fputc_unlocked) -libc_hidden_def(fputc_unlocked) +/* exposing these would be fundamentally *wrong*! fix you, instead! */ +/* libc_hidden_def(fputc_unlocked) */ libc_hidden_proto(putc_unlocked) strong_alias(__fputc_unlocked,putc_unlocked) From aldot at uclibc.org Sat Apr 14 10:34:48 2007 From: aldot at uclibc.org (aldot at uclibc.org) Date: Sat, 14 Apr 2007 10:34:48 -0700 (PDT) Subject: svn commit: trunk/uClibc/extra/Configs Message-ID: <20070414173448.AE1C34801E@busybox.net> Author: aldot Date: 2007-04-14 10:34:47 -0700 (Sat, 14 Apr 2007) New Revision: 18442 Log: - doesn't make sense to impose a limit that is too narrow. 12 ought to be fine.. Modified: trunk/uClibc/extra/Configs/Config.in Changeset: Modified: trunk/uClibc/extra/Configs/Config.in =================================================================== --- trunk/uClibc/extra/Configs/Config.in 2007-04-14 17:03:18 UTC (rev 18441) +++ trunk/uClibc/extra/Configs/Config.in 2007-04-14 17:34:47 UTC (rev 18442) @@ -601,7 +601,7 @@ config UCLIBC_PWD_BUFFER_SIZE int "Buffer size for getpwnam() and friends" default 256 - range 256 1024 + range 12 1024 help This sets the value of the buffer size for getpwnam() and friends. By default, this is 256. (For reference, glibc uses 1024). From sjhill at uclibc.org Sat Apr 14 10:57:23 2007 From: sjhill at uclibc.org (sjhill at uclibc.org) Date: Sat, 14 Apr 2007 10:57:23 -0700 (PDT) Subject: svn commit: branches/uClibc-nptl: include libc/sysdeps/linux/common/bits Message-ID: <20070414175723.2DBF548578@busybox.net> Author: sjhill Date: 2007-04-14 10:57:22 -0700 (Sat, 14 Apr 2007) New Revision: 18443 Log: Merge from trunk. Modified: branches/uClibc-nptl/include/sched.h branches/uClibc-nptl/libc/sysdeps/linux/common/bits/sched.h Changeset: Modified: branches/uClibc-nptl/include/sched.h =================================================================== --- branches/uClibc-nptl/include/sched.h 2007-04-14 17:34:47 UTC (rev 18442) +++ branches/uClibc-nptl/include/sched.h 2007-04-14 17:57:22 UTC (rev 18443) @@ -63,7 +63,7 @@ extern int sched_rr_get_interval (__pid_t __pid, struct timespec *__t) __THROW; -#if 0 /*def __USE_GNU*/ +#ifdef __USE_GNU /* Access macros for `cpu_set'. */ #define CPU_SETSIZE __CPU_SETSIZE #define CPU_SET(cpu, cpusetp) __CPU_SET (cpu, cpusetp) Modified: branches/uClibc-nptl/libc/sysdeps/linux/common/bits/sched.h =================================================================== --- branches/uClibc-nptl/libc/sysdeps/linux/common/bits/sched.h 2007-04-14 17:34:47 UTC (rev 18442) +++ branches/uClibc-nptl/libc/sysdeps/linux/common/bits/sched.h 2007-04-14 17:57:22 UTC (rev 18443) @@ -29,7 +29,7 @@ #define SCHED_OTHER 0 #define SCHED_FIFO 1 #define SCHED_RR 2 -#if 0 /*def __USE_GNU*/ +#ifdef __USE_GNU # define SCHED_BATCH 3 #endif @@ -40,7 +40,6 @@ # define CLONE_FS 0x00000200 /* Set if fs info shared between processes. */ # define CLONE_FILES 0x00000400 /* Set if open files shared between processes. */ # define CLONE_SIGHAND 0x00000800 /* Set if signal handlers shared. */ -# define CLONE_PID 0x00001000 /* Set if pid shared. */ # define CLONE_PTRACE 0x00002000 /* Set if tracing continues on the child. */ # define CLONE_VFORK 0x00004000 /* Set if the parent wants the child to wake it up on mm_release. */ @@ -70,11 +69,16 @@ __BEGIN_DECLS +#ifdef __USE_MISC /* Clone current process. */ -#ifdef __USE_MISC extern int clone (int (*__fn) (void *__arg), void *__child_stack, - int __flags, void *__arg) __THROW; + int __flags, void *__arg, ...) __THROW; + +#if 0 +/* Unshare the specified resources. */ +extern int unshare (int __flags) __THROW; #endif +#endif __END_DECLS @@ -91,6 +95,7 @@ # undef __need_schedparam #endif + #if defined _SCHED_H && !defined __cpu_set_t_defined # define __cpu_set_t_defined /* Size definition for CPU sets. */ @@ -114,8 +119,8 @@ # define __CPU_ZERO(cpusetp) \ do { \ unsigned int __i; \ - cpu_set *__arr = (cpusetp); \ - for (__i = 0; __i < sizeof (cpu_set) / sizeof (__cpu_mask); ++__i) \ + cpu_set_t *__arr = (cpusetp); \ + for (__i = 0; __i < sizeof (cpu_set_t) / sizeof (__cpu_mask); ++__i) \ __arr->__bits[__i] = 0; \ } while (0) # define __CPU_SET(cpu, cpusetp) \ From sjhill at uclibc.org Sat Apr 14 11:25:44 2007 From: sjhill at uclibc.org (sjhill at uclibc.org) Date: Sat, 14 Apr 2007 11:25:44 -0700 (PDT) Subject: svn commit: branches/uClibc-nptl/libc/sysdeps/linux/common Message-ID: <20070414182544.DFC3348564@busybox.net> Author: sjhill Date: 2007-04-14 11:25:44 -0700 (Sat, 14 Apr 2007) New Revision: 18444 Log: Copy from trunk. Added: branches/uClibc-nptl/libc/sysdeps/linux/common/sched_setaffinity.c Changeset: Copied: branches/uClibc-nptl/libc/sysdeps/linux/common/sched_setaffinity.c (from rev 18443, trunk/uClibc/libc/sysdeps/linux/common/sched_setaffinity.c) =================================================================== --- branches/uClibc-nptl/libc/sysdeps/linux/common/sched_setaffinity.c (rev 0) +++ branches/uClibc-nptl/libc/sysdeps/linux/common/sched_setaffinity.c 2007-04-14 18:25:44 UTC (rev 18444) @@ -0,0 +1,78 @@ +/* Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +#include +#ifdef __USE_GNU + +#include +#include +#include + +#ifdef INTERNAL_SYSCALL /* remove this when all archs has this #defined */ + +#include +#include +#include +#include +#include + +libc_hidden_proto(getpid) + +#define __NR___syscall_sched_setaffinity __NR_sched_setaffinity +static inline _syscall3(int, __syscall_sched_setaffinity, __kernel_pid_t, pid, + size_t, cpusetsize, cpu_set_t *, cpuset); + +static size_t __kernel_cpumask_size; + +int sched_setaffinity(pid_t pid, size_t cpusetsize, const cpu_set_t *cpuset) +{ + size_t cnt; + if (unlikely (__kernel_cpumask_size == 0)) { + INTERNAL_SYSCALL_DECL (err); + int res; + size_t psize = 128; + void *p = alloca (psize); + + while (res = INTERNAL_SYSCALL (sched_getaffinity, err, 3, getpid (), + psize, p), + INTERNAL_SYSCALL_ERROR_P (res, err) + && INTERNAL_SYSCALL_ERRNO (res, err) == EINVAL) + p = extend_alloca (p, psize, 2 * psize); + + if (res == 0 || INTERNAL_SYSCALL_ERROR_P (res, err)) { + __set_errno (INTERNAL_SYSCALL_ERRNO (res, err)); + return -1; + } + + __kernel_cpumask_size = res; + } + + /* We now know the size of the kernel cpumask_t. Make sure the user + does not request to set a bit beyond that. */ + for (cnt = __kernel_cpumask_size; cnt < cpusetsize; ++cnt) + if (((char *) cpuset)[cnt] != '\0') { + /* Found a nonzero byte. This means the user request cannot be + fulfilled. */ + __set_errno (EINVAL); + return -1; + } + + return INLINE_SYSCALL (sched_setaffinity, 3, pid, cpusetsize, cpuset); +} +#endif +#endif From sjhill at uclibc.org Sat Apr 14 11:25:55 2007 From: sjhill at uclibc.org (sjhill at uclibc.org) Date: Sat, 14 Apr 2007 11:25:55 -0700 (PDT) Subject: svn commit: branches/uClibc-nptl/libc/sysdeps/linux/common Message-ID: <20070414182555.BEF3148576@busybox.net> Author: sjhill Date: 2007-04-14 11:25:55 -0700 (Sat, 14 Apr 2007) New Revision: 18445 Log: Copy from trunk. Added: branches/uClibc-nptl/libc/sysdeps/linux/common/sched_getaffinity.c Changeset: Copied: branches/uClibc-nptl/libc/sysdeps/linux/common/sched_getaffinity.c (from rev 18444, trunk/uClibc/libc/sysdeps/linux/common/sched_getaffinity.c) =================================================================== --- branches/uClibc-nptl/libc/sysdeps/linux/common/sched_getaffinity.c (rev 0) +++ branches/uClibc-nptl/libc/sysdeps/linux/common/sched_getaffinity.c 2007-04-14 18:25:55 UTC (rev 18445) @@ -0,0 +1,52 @@ +/* Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +#include +#ifdef __USE_GNU + +#include +#include +#include + +#ifdef INTERNAL_SYSCALL /* remove this when all archs has this #defined */ + +#include +#include +#include + +libc_hidden_proto(memset) + +#define __NR___syscall_sched_getaffinity __NR_sched_getaffinity +static inline _syscall3(int, __syscall_sched_getaffinity, __kernel_pid_t, pid, + size_t, cpusetsize, cpu_set_t *, cpuset); + +int sched_getaffinity(pid_t pid, size_t cpusetsize, cpu_set_t *cpuset) +{ + int res = (__syscall_sched_getaffinity(pid, MIN(INT_MAX, cpusetsize), + cpuset)); + + if (res != -1) { + /* Clean the rest of the memory the kernel didn't do. */ + memset ((char *) cpuset + res, '\0', cpusetsize - res); + + res = 0; + } + return res; +} +#endif +#endif From sjhill at uclibc.org Sat Apr 14 12:16:06 2007 From: sjhill at uclibc.org (sjhill at uclibc.org) Date: Sat, 14 Apr 2007 12:16:06 -0700 (PDT) Subject: svn commit: branches/uClibc-nptl/libc/misc/internals Message-ID: <20070414191606.EBA2B48576@busybox.net> Author: sjhill Date: 2007-04-14 12:16:06 -0700 (Sat, 14 Apr 2007) New Revision: 18446 Log: Fix up header files. Modified: branches/uClibc-nptl/libc/misc/internals/__uClibc_main.c Changeset: Modified: branches/uClibc-nptl/libc/misc/internals/__uClibc_main.c =================================================================== --- branches/uClibc-nptl/libc/misc/internals/__uClibc_main.c 2007-04-14 18:25:55 UTC (rev 18445) +++ branches/uClibc-nptl/libc/misc/internals/__uClibc_main.c 2007-04-14 19:16:06 UTC (rev 18446) @@ -15,10 +15,8 @@ * avoided in the static library case. */ -#include -#ifndef __UCLIBC_HAS_THREADS_NATIVE__ #define _ERRNO_H -#endif +#include #include #include #include @@ -32,7 +30,6 @@ #include #include #ifdef __UCLIBC_HAS_THREADS_NATIVE__ -#include #include #include #endif From bugs at busybox.net Mon Apr 16 05:49:43 2007 From: bugs at busybox.net (bugs at busybox.net) Date: Mon, 16 Apr 2007 05:49:43 -0700 Subject: [uClibc 0001240]: SIGSEGV for statically linked libraries in 0.9.28.2 Message-ID: <5cff8facb2895546390a6e7b39b2a000@bugs.uclibc.org> A NOTE has been added to this issue. ====================================================================== http://busybox.net/bugs/view.php?id=1240 ====================================================================== Reported By: jamesjuran Assigned To: uClibc ====================================================================== Project: uClibc Issue ID: 1240 Category: Stdio Reproducibility: always Severity: crash Priority: normal Status: assigned ====================================================================== Date Submitted: 02-27-2007 12:31 PST Last Modified: 04-16-2007 05:49 PDT ====================================================================== Summary: SIGSEGV for statically linked libraries in 0.9.28.2 Description: It looks like the bug reported in issue 1163 was backported to the 0.9.28 branch and released in 0.9.28.2 without backporting the fix for issue 1163 (r17253). This seems to make statically linked executables with shared libraries segfault upon first use of a libc function. Note that this problem occurs only with 0.9.28.2, not 0.9.28.1. The "product version" doesn't have 0.9.28.2 as an available choice. ====================================================================== ---------------------------------------------------------------------- jamesjuran - 04-16-07 05:49 ---------------------------------------------------------------------- This problem has been fixed in 0.9.28.3. Issue History Date Modified Username Field Change ====================================================================== 02-27-07 12:31 jamesjuran New Issue 02-27-07 12:31 jamesjuran Status new => assigned 02-27-07 12:31 jamesjuran Assigned To => uClibc 04-16-07 05:49 jamesjuran Note Added: 0002321 ====================================================================== From bugs at busybox.net Mon Apr 16 18:08:44 2007 From: bugs at busybox.net (bugs at busybox.net) Date: Mon, 16 Apr 2007 18:08:44 -0700 Subject: [uClibc 0001240]: SIGSEGV for statically linked libraries in 0.9.28.2 Message-ID: <9085344dfde414e03c084d6ec1f8fe3b@busybox.net> The following issue has been CLOSED ====================================================================== http://busybox.net/bugs/view.php?id=1240 ====================================================================== Reported By: jamesjuran Assigned To: uClibc ====================================================================== Project: uClibc Issue ID: 1240 Category: Stdio Reproducibility: always Severity: crash Priority: normal Status: closed Resolution: fixed Fixed in Version: ====================================================================== Date Submitted: 02-27-2007 12:31 PST Last Modified: 04-16-2007 18:08 PDT ====================================================================== Summary: SIGSEGV for statically linked libraries in 0.9.28.2 Description: It looks like the bug reported in issue 1163 was backported to the 0.9.28 branch and released in 0.9.28.2 without backporting the fix for issue 1163 (r17253). This seems to make statically linked executables with shared libraries segfault upon first use of a libc function. Note that this problem occurs only with 0.9.28.2, not 0.9.28.1. The "product version" doesn't have 0.9.28.2 as an available choice. ====================================================================== ---------------------------------------------------------------------- jamesjuran - 04-16-07 05:49 ---------------------------------------------------------------------- This problem has been fixed in 0.9.28.3. Issue History Date Modified Username Field Change ====================================================================== 02-27-07 12:31 jamesjuran New Issue 02-27-07 12:31 jamesjuran Status new => assigned 02-27-07 12:31 jamesjuran Assigned To => uClibc 04-16-07 05:49 jamesjuran Note Added: 0002321 04-16-07 18:08 vapier Status assigned => closed 04-16-07 18:08 vapier Resolution open => fixed ====================================================================== From vapier at uclibc.org Tue Apr 17 04:38:22 2007 From: vapier at uclibc.org (vapier at uclibc.org) Date: Tue, 17 Apr 2007 04:38:22 -0700 (PDT) Subject: svn commit: trunk/uClibc/extra/config Message-ID: <20070417113822.8EBA2485DB@busybox.net> Author: vapier Date: 2007-04-17 04:38:21 -0700 (Tue, 17 Apr 2007) New Revision: 18465 Log: add a basic .depend target to better catch updates in source files Modified: trunk/uClibc/extra/config/Makefile Changeset: Modified: trunk/uClibc/extra/config/Makefile =================================================================== --- trunk/uClibc/extra/config/Makefile 2007-04-16 23:23:33 UTC (rev 18464) +++ trunk/uClibc/extra/config/Makefile 2007-04-17 11:38:21 UTC (rev 18465) @@ -7,6 +7,10 @@ include Makefile.kconfig +-include .depend +.depend: $(wildcard *.h *.c) + $(HOSTCC) $(HOST_EXTRACFLAGS) $(HOSTCFLAGS) -MM *.c > .depend 2>/dev/null || : + __hostprogs := $(sort $(hostprogs-y) $(hostprogs-m)) host-csingle := $(foreach m,$(__hostprogs),$(if $($(m)-objs),,$(m))) host-cmulti := $(foreach m,$(__hostprogs),\ From vapier at uclibc.org Tue Apr 17 04:40:14 2007 From: vapier at uclibc.org (vapier at uclibc.org) Date: Tue, 17 Apr 2007 04:40:14 -0700 (PDT) Subject: svn commit: trunk/uClibc/extra/config Message-ID: <20070417114014.5B755485DE@busybox.net> Author: vapier Date: 2007-04-17 04:40:14 -0700 (Tue, 17 Apr 2007) New Revision: 18466 Log: ignore .depend Modified: trunk/uClibc/extra/config/ Changeset: Property changes on: trunk/uClibc/extra/config ___________________________________________________________________ Name: svn:ignore - conf mconf lkc_defs.h lex.zconf.c zconf.hash.c zconf.tab.h zconf.tab.c lex.backup zconf.output + .depend conf mconf lkc_defs.h lex.zconf.c zconf.hash.c zconf.tab.h zconf.tab.c lex.backup zconf.output From vapier at uclibc.org Tue Apr 17 04:45:21 2007 From: vapier at uclibc.org (vapier at uclibc.org) Date: Tue, 17 Apr 2007 04:45:21 -0700 (PDT) Subject: svn commit: trunk/uClibc/test/pthread Message-ID: <20070417114521.9826B485E1@busybox.net> Author: vapier Date: 2007-04-17 04:45:20 -0700 (Tue, 17 Apr 2007) New Revision: 18467 Log: disable for now Modified: trunk/uClibc/test/pthread/tst-too-many-cleanups.c Changeset: Modified: trunk/uClibc/test/pthread/tst-too-many-cleanups.c =================================================================== --- trunk/uClibc/test/pthread/tst-too-many-cleanups.c 2007-04-17 11:40:14 UTC (rev 18466) +++ trunk/uClibc/test/pthread/tst-too-many-cleanups.c 2007-04-17 11:45:20 UTC (rev 18467) @@ -52,15 +52,19 @@ /* main code */ warnf("please kill me now\n"); - while (1) + while (1) { ok_to_kill_thread = 1; + sleep(1); + } pthread_cleanup_pop(0); + + return 0; } static void thread_killed(void *arg) { - static num_times_called = 0; + static int num_times_called = 0; warnf("killing %p [cnt=%i]\n", arg, ++num_times_called); assert(num_times_called == 1); @@ -79,13 +83,16 @@ int count = 3; pthread_t app_pthread_id; + /* need to tweak this test a bit to play nice with signals and LT */ + return 0; + ok_to_kill_thread = 0; pthread_create(&app_pthread_id, NULL, KillMeThread, NULL); warnf("waiting for thread to prepare itself\n"); while (!ok_to_kill_thread) - ; + sleep(1); while (count--) { warnf("killing thread\n"); From vapier at uclibc.org Tue Apr 17 04:58:38 2007 From: vapier at uclibc.org (vapier at uclibc.org) Date: Tue, 17 Apr 2007 04:58:38 -0700 (PDT) Subject: svn commit: trunk/uClibc/test/malloc Message-ID: <20070417115838.85DCC485CC@busybox.net> Author: vapier Date: 2007-04-17 04:58:35 -0700 (Tue, 17 Apr 2007) New Revision: 18468 Log: catch a small overflow in malloc-standard Added: trunk/uClibc/test/malloc/malloc-standard-alignment.c Changeset: Added: trunk/uClibc/test/malloc/malloc-standard-alignment.c =================================================================== --- trunk/uClibc/test/malloc/malloc-standard-alignment.c (rev 0) +++ trunk/uClibc/test/malloc/malloc-standard-alignment.c 2007-04-17 11:58:35 UTC (rev 18468) @@ -0,0 +1,42 @@ +/* exercise a bug found in malloc-standard when alignment + * values are out of whack and cause a small overflow into + * actual user data. + */ + +#include +#include +#include + +#define ok(p) ((void*)p > (void*)0x1000) +#define x \ + do { \ + printf("%i: phead = %p, phead->link @ %p = %p %s\n", \ + __LINE__, phead, \ + ok(phead) ? &phead->link : 0, \ + ok(phead) ? phead->link : 0, \ + ok(phead) ? phead->link == 0 ? "" : "!!!!!!!!!!!" : ""); \ + if (phead->link != NULL) exit(1); \ + } while (0); + +struct llist_s { + void *data; + struct llist_s *link; +} *phead; + +int main() +{ + char *line, *reg; + + setbuf(stdout, NULL); + setbuf(stderr, NULL); + + phead = malloc(sizeof(*phead)); + phead->link = NULL; + +x line = malloc(80); +x line = realloc(line, 2); +x reg = malloc(32); +x free(line); + +x return 0; +} From vapier at uclibc.org Tue Apr 17 06:04:50 2007 From: vapier at uclibc.org (vapier at uclibc.org) Date: Tue, 17 Apr 2007 06:04:50 -0700 (PDT) Subject: svn commit: trunk/uClibc/test/malloc Message-ID: <20070417130450.1467D485BF@busybox.net> Author: vapier Date: 2007-04-17 06:04:49 -0700 (Tue, 17 Apr 2007) New Revision: 18469 Log: update Modified: trunk/uClibc/test/malloc/ Changeset: Property changes on: trunk/uClibc/test/malloc ___________________________________________________________________ Name: svn:ignore - malloc mallocbug realloc0 testmalloc tst-calloc tst-malloc tst-mallocfork tst-mcheck tst-obstack tst-valloc *_glibc *.gdb *.out + malloc mallocbug malloc-standard-alignment realloc0 realloc-can-shrink testmalloc tst-calloc tst-malloc tst-mallocfork tst-mcheck tst-obstack tst-valloc *_glibc *.gdb *.out From vapier at uclibc.org Tue Apr 17 06:05:21 2007 From: vapier at uclibc.org (vapier at uclibc.org) Date: Tue, 17 Apr 2007 06:05:21 -0700 (PDT) Subject: svn commit: trunk/uClibc Message-ID: <20070417130521.2DA25485E0@busybox.net> Author: vapier Date: 2007-04-17 06:05:20 -0700 (Tue, 17 Apr 2007) New Revision: 18470 Log: dont force a . before EXTRAVERSION so we can be a little more flexible with versioning Modified: trunk/uClibc/Rules.mak Changeset: Modified: trunk/uClibc/Rules.mak =================================================================== --- trunk/uClibc/Rules.mak 2007-04-17 13:04:49 UTC (rev 18469) +++ trunk/uClibc/Rules.mak 2007-04-17 13:05:20 UTC (rev 18470) @@ -81,7 +81,7 @@ EXTRAVERSION := VERSION := $(MAJOR_VERSION).$(MINOR_VERSION).$(SUBLEVEL) ifneq ($(EXTRAVERSION),) -VERSION := $(VERSION).$(EXTRAVERSION) +VERSION := $(VERSION)$(EXTRAVERSION) endif # Ensure consistent sort order, 'gcc -print-search-dirs' behavior, etc. LC_ALL := C From vapier at uclibc.org Tue Apr 17 06:07:24 2007 From: vapier at uclibc.org (vapier at uclibc.org) Date: Tue, 17 Apr 2007 06:07:24 -0700 (PDT) Subject: svn commit: tags: uClibc_0_9_29_rc1 uClibc_0_9_29_rc1/tes etc... Message-ID: <20070417130724.AF605485E0@busybox.net> Author: vapier Date: 2007-04-17 06:07:24 -0700 (Tue, 17 Apr 2007) New Revision: 18471 Log: tag 0.9.29_rc1 Added: tags/uClibc_0_9_29_rc1/ tags/uClibc_0_9_29_rc1/Rules.mak tags/uClibc_0_9_29_rc1/test/malloc/ Removed: tags/uClibc_0_9_29_rc1/Rules.mak tags/uClibc_0_9_29_rc1/test/malloc/ Changeset: Sorry, the patch is too large to include (1059 lines). Please use ViewCVS to see it! http://uclibc.org/cgi-bin/viewcvs.cgi?view=rev&root=svn&rev=18471 From vapier at uclibc.org Tue Apr 17 06:11:22 2007 From: vapier at uclibc.org (vapier at uclibc.org) Date: Tue, 17 Apr 2007 06:11:22 -0700 (PDT) Subject: svn commit: trunk: uClibc/docs website Message-ID: <20070417131122.13A67485E0@busybox.net> Author: vapier Date: 2007-04-17 06:11:21 -0700 (Tue, 17 Apr 2007) New Revision: 18472 Log: move uclibc.org out of actual source tree Added: trunk/website/ trunk/website/uclibc.org/ Removed: trunk/uClibc/docs/uclibc.org/ Changeset: Copied: trunk/website/uclibc.org (from rev 18468, trunk/uClibc/docs/uclibc.org) From vapier at uclibc.org Tue Apr 17 06:34:13 2007 From: vapier at uclibc.org (vapier at uclibc.org) Date: Tue, 17 Apr 2007 06:34:13 -0700 (PDT) Subject: svn commit: trunk/uClibc Message-ID: <20070417133413.B3484485F5@busybox.net> Author: vapier Date: 2007-04-17 06:34:11 -0700 (Tue, 17 Apr 2007) New Revision: 18475 Log: force ourselves to write proper code and develop testscases Modified: trunk/uClibc/Rules.mak Changeset: Modified: trunk/uClibc/Rules.mak =================================================================== --- trunk/uClibc/Rules.mak 2007-04-17 13:23:42 UTC (rev 18474) +++ trunk/uClibc/Rules.mak 2007-04-17 13:34:11 UTC (rev 18475) @@ -388,9 +388,6 @@ endif endif -# Make sure "char" behavior is the same everywhere -CFLAGS += -fsigned-char - # We need this to be checked within libc-symbols.h ifneq ($(HAVE_SHARED),y) CFLAGS += -DSTATIC From aldot at uclibc.org Tue Apr 17 10:24:34 2007 From: aldot at uclibc.org (aldot at uclibc.org) Date: Tue, 17 Apr 2007 10:24:34 -0700 (PDT) Subject: svn commit: trunk/uClibc: extra/Configs include libc/inet Message-ID: <20070417172434.89ABB4809E@busybox.net> Author: aldot Date: 2007-04-17 10:24:29 -0700 (Tue, 17 Apr 2007) New Revision: 18480 Log: - shrink resolver code Modified: trunk/uClibc/extra/Configs/Config.in trunk/uClibc/include/resolv.h trunk/uClibc/libc/inet/Makefile.in trunk/uClibc/libc/inet/resolv.c Changeset: Modified: trunk/uClibc/extra/Configs/Config.in =================================================================== --- trunk/uClibc/extra/Configs/Config.in 2007-04-17 17:12:48 UTC (rev 18479) +++ trunk/uClibc/extra/Configs/Config.in 2007-04-17 17:24:29 UTC (rev 18480) @@ -672,6 +672,15 @@ Most people can safely answer N. +config UCLIBC_HAS_BSD_RES_CLOSE + bool "Support res_close() (bsd-compat)" + default n + help + Answer Y if you desperately want to support BSD compatibility in + the network code. + + Most people will say N. + endmenu Modified: trunk/uClibc/include/resolv.h =================================================================== --- trunk/uClibc/include/resolv.h 2007-04-17 17:12:48 UTC (rev 18479) +++ trunk/uClibc/include/resolv.h 2007-04-17 17:24:29 UTC (rev 18480) @@ -274,7 +274,9 @@ void fp_query (const u_char *, FILE *) __THROW; const char * hostalias (const char *) __THROW; void p_query (const u_char *) __THROW; +#ifdef __UCLIBC_HAS_BSD_RES_CLOSE__ void res_close (void) __THROW; +#endif int res_init (void) __THROW; int res_isourserver (const struct sockaddr_in *) __THROW; int res_mkquery (int, const char *, int, int, const u_char *, Modified: trunk/uClibc/libc/inet/Makefile.in =================================================================== --- trunk/uClibc/libc/inet/Makefile.in 2007-04-17 17:12:48 UTC (rev 18479) +++ trunk/uClibc/libc/inet/Makefile.in 2007-04-17 17:24:29 UTC (rev 18480) @@ -17,14 +17,17 @@ # multi source resolv.c CSRC += encodeh.c decodeh.c encoded.c decoded.c lengthd.c encodeq.c \ - decodeq.c lengthq.c encodea.c decodea.c encodep.c decodep.c \ - formquery.c dnslookup.c resolveaddress.c opennameservers.c \ + decodeq.c lengthq.c encodea.c decodea.c \ + dnslookup.c resolveaddress.c opennameservers.c \ closenameservers.c resolvename.c gethostbyname.c res_init.c \ res_query.c gethostbyaddr.c read_etc_hosts_r.c get_hosts_byname_r.c \ get_hosts_byaddr_r.c gethostbyname2.c getnameinfo.c gethostent.c \ gethostbyname_r.c gethostbyname2_r.c gethostbyaddr_r.c \ res_comp.c ns_name.c +# unused ATM +CSRC += encodep.c decodep.c formquery.c + # multi source socketcalls.c CSRC += accept.c bind.c connect.c getpeername.c getsockname.c getsockopt.c \ listen.c recv.c recvfrom.c recvmsg.c send.c sendmsg.c sendto.c \ Modified: trunk/uClibc/libc/inet/resolv.c =================================================================== --- trunk/uClibc/libc/inet/resolv.c 2007-04-17 17:12:48 UTC (rev 18479) +++ trunk/uClibc/libc/inet/resolv.c 2007-04-17 17:24:29 UTC (rev 18480) @@ -265,7 +265,7 @@ int aclass; int ttl; int rdlength; - unsigned char * rdata; + const unsigned char * rdata; int rdoffset; char* buf; size_t buflen; @@ -300,21 +300,21 @@ char ** nsip, unsigned char ** outpacket, struct resolv_answer * a) attribute_hidden; extern int __encode_dotted(const char * dotted, unsigned char * dest, int maxlen) attribute_hidden; -extern int __decode_dotted(const unsigned char * message, int offset, +extern int __decode_dotted(const unsigned char * const message, int offset, char * dest, int maxlen) attribute_hidden; -extern int __length_dotted(const unsigned char * message, int offset) attribute_hidden; +extern int __length_dotted(const unsigned char * const message, int offset) attribute_hidden; extern int __encode_header(struct resolv_header * h, unsigned char * dest, int maxlen) attribute_hidden; extern int __decode_header(unsigned char * data, struct resolv_header * h) attribute_hidden; -extern int __encode_question(struct resolv_question * q, +extern int __encode_question(const struct resolv_question * const q, unsigned char * dest, int maxlen) attribute_hidden; -extern int __decode_question(unsigned char * message, int offset, +extern int __decode_question(const unsigned char * const message, int offset, struct resolv_question * q) attribute_hidden; extern int __encode_answer(struct resolv_answer * a, unsigned char * dest, int maxlen) attribute_hidden; -extern int __decode_answer(unsigned char * message, int offset, +extern int __decode_answer(const unsigned char * message, int offset, struct resolv_answer * a) attribute_hidden; -extern int __length_question(unsigned char * message, int offset) attribute_hidden; -extern int __open_nameservers(void) attribute_hidden; +extern int __length_question(const unsigned char * const message, int offset) attribute_hidden; +extern void __open_nameservers(void) attribute_hidden; extern void __close_nameservers(void) attribute_hidden; extern int __dn_expand(const u_char *, const u_char *, const u_char *, char *, int); @@ -373,7 +373,7 @@ int attribute_hidden __encode_dotted(const char *dotted, unsigned char *dest, int maxlen) { - int used = 0; + unsigned used = 0; while (dotted && *dotted) { char *c = strchr(dotted, '.'); @@ -405,13 +405,13 @@ /* Decode a dotted string from nameserver transport-level encoding. This routine understands compressed data. */ -int attribute_hidden __decode_dotted(const unsigned char *data, int offset, +int attribute_hidden __decode_dotted(const unsigned char * const data, int offset, char *dest, int maxlen) { int l; - int measure = 1; - int total = 0; - int used = 0; + bool measure = 1; + unsigned total = 0; + unsigned used = 0; if (!data) return -1; @@ -455,7 +455,7 @@ #endif #ifdef L_lengthd -int attribute_hidden __length_dotted(const unsigned char *data, int offset) +int attribute_hidden __length_dotted(const unsigned char * const data, int offset) { int orig_offset = offset; int l; @@ -478,7 +478,7 @@ #endif #ifdef L_encodeq -int attribute_hidden __encode_question(struct resolv_question *q, +int attribute_hidden __encode_question(const struct resolv_question * const q, unsigned char *dest, int maxlen) { int i; @@ -503,7 +503,7 @@ #endif #ifdef L_decodeq -int attribute_hidden __decode_question(unsigned char *message, int offset, +int attribute_hidden __decode_question(const unsigned char * const message, int offset, struct resolv_question *q) { char temp[256]; @@ -524,7 +524,7 @@ #endif #ifdef L_lengthq -int attribute_hidden __length_question(unsigned char *message, int offset) +int attribute_hidden __length_question(const unsigned char * const message, int offset) { int i; @@ -568,7 +568,7 @@ #endif #ifdef L_decodea -int attribute_hidden __decode_answer(unsigned char *message, int offset, +int attribute_hidden __decode_answer(const unsigned char *message, int offset, struct resolv_answer *a) { char temp[256]; @@ -614,7 +614,7 @@ unsigned char *dest, int maxlen) { int i, total = 0; - int j; + unsigned j; i = __encode_header(h, dest, maxlen); if (i < 0) @@ -717,15 +717,15 @@ struct resolv_header h; struct resolv_question q; struct resolv_answer ma; - int first_answer = 1; - int retries = 0; + bool first_answer = 1; + unsigned retries = 0; unsigned char * packet = malloc(PACKETSZ); char *dns, *lookup = malloc(MAXDNAME); int variant = -1; struct sockaddr_in sa; int local_ns = -1, local_id = -1; #ifdef __UCLIBC_HAS_IPV6__ - int v6; + bool v6; struct sockaddr_in6 sa6; #endif @@ -1032,14 +1032,14 @@ * unix systems, we can have a list of nameservers after the keyword. */ -int attribute_hidden __open_nameservers() +void attribute_hidden __open_nameservers() { FILE *fp; int i; #define RESOLV_ARGS 5 char szBuffer[128], *p, *argv[RESOLV_ARGS]; int argc; - int rv = 0; + /* int rv = 0; */ __UCLIBC_MUTEX_LOCK(__resolv_lock); if (__nameservers > 0) { @@ -1091,11 +1091,11 @@ DPRINTF("failed to open %s\n", "resolv.conf"); h_errno = NO_RECOVERY; - rv = -1; + /* rv = -1; */ DONE: __UCLIBC_MUTEX_UNLOCK(__resolv_lock); - return rv; + /* return rv; */ } #endif @@ -1207,10 +1207,13 @@ } libc_hidden_def(res_init) +#ifdef __UCLIBC_HAS_BSD_RES_CLOSE__ void res_close( void ) { - return; + __close_nameservers(); + memset(&_res, 0, sizeof(_res)); } +#endif #endif @@ -1270,6 +1273,10 @@ * If enabled, implement search rules until answer or unrecoverable failure * is detected. Error code, if any, is left in h_errno. */ +#define __TRAILING_DOT (1<<0) +#define __GOT_NODATA (1<<1) +#define __GOT_SERVFAIL (1<<2) +#define __TRIED_AS_IS (1<<3) int res_search(name, class, type, answer, anslen) const char *name; /* domain name */ int class, type; /* class and type of query */ @@ -1279,8 +1286,8 @@ const char *cp, * const *domain; HEADER *hp = (HEADER *)(void *)answer; u_int dots; - int trailing_dot, ret, saved_herrno; - int got_nodata = 0, got_servfail = 0, tried_as_is = 0; + unsigned _state = 0; + int ret, saved_herrno; u_long _res_options; unsigned _res_ndots; char **_res_dnsrch; @@ -1298,9 +1305,9 @@ dots = 0; for (cp = name; *cp; cp++) dots += (*cp == '.'); - trailing_dot = 0; + if (cp > name && *--cp == '.') - trailing_dot++; + _state |= __TRAILING_DOT; /* * If there are dots in the name already, let's just give it a try @@ -1315,7 +1322,7 @@ if (ret > 0) return (ret); saved_herrno = h_errno; - tried_as_is++; + _state |= __TRIED_AS_IS; } /* @@ -1329,8 +1336,8 @@ _res_dnsrch = _res.dnsrch; __UCLIBC_MUTEX_UNLOCK(__resolv_lock); if ((!dots && (_res_options & RES_DEFNAMES)) || - (dots && !trailing_dot && (_res_options & RES_DNSRCH))) { - int done = 0; + (dots && !(_state & __TRAILING_DOT) && (_res_options & RES_DNSRCH))) { + bool done = 0; for (domain = (const char * const *)_res_dnsrch; *domain && !done; @@ -1361,7 +1368,7 @@ switch (h_errno) { case NO_DATA: - got_nodata++; + _state |= __GOT_NODATA; /* FALLTHROUGH */ case HOST_NOT_FOUND: /* keep trying */ @@ -1369,13 +1376,13 @@ case TRY_AGAIN: if (hp->rcode == SERVFAIL) { /* try next search element, if any */ - got_servfail++; + _state |= __GOT_SERVFAIL; break; } /* FALLTHROUGH */ default: /* anything else implies that we're done */ - done++; + done = 1; } /* * if we got here for some reason other than DNSRCH, @@ -1385,7 +1392,7 @@ _res_options = _res.options; __UCLIBC_MUTEX_UNLOCK(__resolv_lock); if (!(_res_options & RES_DNSRCH)) - done++; + done = 1; } } @@ -1394,7 +1401,7 @@ * note that we do this regardless of how many dots were in the * name or whether it ends with a dot. */ - if (!tried_as_is) { + if (!(_state & __TRIED_AS_IS)) { ret = res_querydomain(name, NULL, class, type, answer, anslen); if (ret > 0) return (ret); @@ -1410,13 +1417,16 @@ */ if (saved_herrno != -1) h_errno = saved_herrno; - else if (got_nodata) + else if (_state & __GOT_NODATA) h_errno = NO_DATA; - else if (got_servfail) + else if (_state & __GOT_SERVFAIL) h_errno = TRY_AGAIN; return (-1); } - +#undef __TRAILING_DOT +#undef __GOT_NODATA +#undef __GOT_SERVFAIL +#undef __TRIED_AS_IS /* * Perform a call on res_query on the concatenation of name and domain, * removing a trailing dot from name if domain is NULL. @@ -1695,15 +1705,15 @@ if (__gethostent_fp == NULL) { __open_etc_hosts(&__gethostent_fp); if (__gethostent_fp == NULL) { - *result=NULL; - ret=TRY_AGAIN; + *result = NULL; + ret = TRY_AGAIN; goto DONE; } } ret = __read_etc_hosts_r(__gethostent_fp, NULL, AF_INET, GETHOSTENT, result_buf, buf, buflen, result, h_errnop); - if (__stay_open==0) { + if (__stay_open == 0) { fclose(__gethostent_fp); } DONE: @@ -1793,7 +1803,7 @@ unsigned int flags) { int serrno = errno; - int ok = 0; + unsigned ok; struct hostent *h = NULL; char domain[256]; @@ -1801,25 +1811,23 @@ return EAI_BADFLAGS; if (sa == NULL || addrlen < sizeof (sa_family_t)) - return EAI_FAMILY; + goto BAD_FAM; - switch (sa->sa_family) { - case AF_LOCAL: - break; - case AF_INET: + ok = sa->sa_family; + if (ok == AF_LOCAL) /* valid */; + else if (ok == AF_INET) { if (addrlen < sizeof (struct sockaddr_in)) - return EAI_FAMILY; - break; + goto BAD_FAM; #ifdef __UCLIBC_HAS_IPV6__ - case AF_INET6: + } else if (ok == AF_INET6) { if (addrlen < sizeof (struct sockaddr_in6)) - return EAI_FAMILY; - break; + goto BAD_FAM; #endif /* __UCLIBC_HAS_IPV6__ */ - default: + } else +BAD_FAM: return EAI_FAMILY; - } + ok = 0; if (host != NULL && hostlen > 0) switch (sa->sa_family) { case AF_INET: @@ -1939,34 +1947,29 @@ strncpy (host, "localhost", hostlen); break; - default: +/*Already checked above default: return EAI_FAMILY; +*/ } if (serv && (servlen > 0)) { - switch (sa->sa_family) { - case AF_INET: -#ifdef __UCLIBC_HAS_IPV6__ - case AF_INET6: -#endif /* __UCLIBC_HAS_IPV6__ */ + if (sa->sa_family == AF_LOCAL) { + strncpy (serv, ((const struct sockaddr_un *) sa)->sun_path, servlen); + } else { /* AF_INET || AF_INET6 */ if (!(flags & NI_NUMERICSERV)) { struct servent *s; s = getservbyport (((const struct sockaddr_in *) sa)->sin_port, ((flags & NI_DGRAM) ? "udp" : "tcp")); if (s) { strncpy (serv, s->s_name, servlen); - break; + goto DONE; } } snprintf (serv, servlen, "%d", ntohs (((const struct sockaddr_in *) sa)->sin_port)); - break; - - case AF_LOCAL: - strncpy (serv, ((const struct sockaddr_un *) sa)->sun_path, servlen); - break; } } +DONE: if (host && (hostlen > 0)) host[hostlen-1] = 0; if (serv && (servlen > 0)) @@ -2399,8 +2402,8 @@ for (i = len - 1; i >= 0; i--) { 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__ */ } @@ -2452,7 +2455,7 @@ } else { result_buf->h_length = sizeof(*in6); #endif /* __UCLIBC_HAS_IPV6__ */ - } + } result_buf->h_addr_list = (char **) addr_list; result_buf->h_aliases = alias; From vapier at uclibc.org Tue Apr 17 14:54:12 2007 From: vapier at uclibc.org (vapier at uclibc.org) Date: Tue, 17 Apr 2007 14:54:12 -0700 (PDT) Subject: svn commit: trunk/uClibc: ldso/include ldso/ldso utils Message-ID: <20070417215412.7B947485A4@busybox.net> Author: vapier Date: 2007-04-17 14:54:11 -0700 (Tue, 17 Apr 2007) New Revision: 18482 Log: fix ld.so.cache handling on no-mmu setups Modified: trunk/uClibc/ldso/include/dl-defs.h trunk/uClibc/ldso/ldso/dl-elf.c trunk/uClibc/utils/ldconfig.c Changeset: Modified: trunk/uClibc/ldso/include/dl-defs.h =================================================================== --- trunk/uClibc/ldso/include/dl-defs.h 2007-04-17 17:30:12 UTC (rev 18481) +++ trunk/uClibc/ldso/include/dl-defs.h 2007-04-17 21:54:11 UTC (rev 18482) @@ -62,6 +62,12 @@ int sooffset; int liboffset; } libentry_t; + +#ifdef __ARCH_USE_MMU__ +#define LDSO_CACHE_MMAP_FLAGS (MAP_SHARED) +#else +#define LDSO_CACHE_MMAP_FLAGS (MAP_PRIVATE) +#endif #endif /* __LDSO_CACHE_SUPPORT__ */ #endif Modified: trunk/uClibc/ldso/ldso/dl-elf.c =================================================================== --- trunk/uClibc/ldso/ldso/dl-elf.c 2007-04-17 17:30:12 UTC (rev 18481) +++ trunk/uClibc/ldso/ldso/dl-elf.c 2007-04-17 21:54:11 UTC (rev 18482) @@ -57,7 +57,7 @@ } _dl_cache_size = st.st_size; - _dl_cache_addr = (caddr_t) _dl_mmap(0, _dl_cache_size, PROT_READ, MAP_SHARED, fd, 0); + _dl_cache_addr = _dl_mmap(0, _dl_cache_size, PROT_READ, LDSO_CACHE_MMAP_FLAGS, fd, 0); _dl_close(fd); if (_dl_mmap_check_error(_dl_cache_addr)) { _dl_dprintf(2, "%s:%i: can't map '%s'\n", Modified: trunk/uClibc/utils/ldconfig.c =================================================================== --- trunk/uClibc/utils/ldconfig.c 2007-04-17 17:30:12 UTC (rev 18481) +++ trunk/uClibc/utils/ldconfig.c 2007-04-17 21:54:11 UTC (rev 18482) @@ -813,7 +813,7 @@ if (stat(realcachefile, &st) || (fd = open(realcachefile, O_RDONLY))<0) err(EXIT_FATAL,"can't read %s (%s)", cachefile, strerror(errno)); - if ((c = mmap(0,st.st_size, PROT_READ, MAP_SHARED ,fd, 0)) == (caddr_t)-1) + if ((c = mmap(0,st.st_size, PROT_READ, LDSO_CACHE_MMAP_FLAGS, fd, 0)) == (caddr_t)-1) err(EXIT_FATAL,"can't map %s (%s)", cachefile, strerror(errno)); close(fd); From vapier at uclibc.org Tue Apr 17 15:31:03 2007 From: vapier at uclibc.org (vapier at uclibc.org) Date: Tue, 17 Apr 2007 15:31:03 -0700 (PDT) Subject: svn commit: trunk/uClibc/utils Message-ID: <20070417223103.BC1294809E@busybox.net> Author: vapier Date: 2007-04-17 15:31:01 -0700 (Tue, 17 Apr 2007) New Revision: 18483 Log: cleanup style; no functional changes Modified: trunk/uClibc/utils/chroot_realpath.c trunk/uClibc/utils/ldconfig.c trunk/uClibc/utils/ldd.c trunk/uClibc/utils/readsoname2.c Changeset: Sorry, the patch is too large to include (2513 lines). Please use ViewCVS to see it! http://uclibc.org/cgi-bin/viewcvs.cgi?view=rev&root=svn&rev=18483 From vapier at uclibc.org Tue Apr 17 16:08:21 2007 From: vapier at uclibc.org (vapier at uclibc.org) Date: Tue, 17 Apr 2007 16:08:21 -0700 (PDT) Subject: svn commit: trunk/uClibc/utils Message-ID: <20070417230821.D77FF485D5@busybox.net> Author: vapier Date: 2007-04-17 16:08:20 -0700 (Tue, 17 Apr 2007) New Revision: 18484 Log: if chroot() failed, then reset "chroot_dir" to "." so that after we do our fallback chdir(), we dont continue to prefix the chroot path ... fixes `ldconfig.host -r some/dir/` Modified: trunk/uClibc/utils/ldconfig.c Changeset: Modified: trunk/uClibc/utils/ldconfig.c =================================================================== --- trunk/uClibc/utils/ldconfig.c 2007-04-17 22:31:01 UTC (rev 18483) +++ trunk/uClibc/utils/ldconfig.c 2007-04-17 23:08:20 UTC (rev 18484) @@ -918,6 +918,7 @@ if (chroot(chroot_dir) < 0) { if (chdir(chroot_dir) < 0) err(EXIT_FATAL, "couldn't chroot to %s (%s)", chroot_dir, strerror(errno)); + chroot_dir = "."; } else { if (chdir("/") < 0) err(EXIT_FATAL, "couldn't chdir to / (%s)", strerror(errno)); From landley at uclibc.org Wed Apr 18 09:26:17 2007 From: landley at uclibc.org (landley at uclibc.org) Date: Wed, 18 Apr 2007 09:26:17 -0700 (PDT) Subject: svn commit: trunk/uClibc/libc/inet Message-ID: <20070418162617.5156648092@busybox.net> Author: landley Date: 2007-04-18 09:26:16 -0700 (Wed, 18 Apr 2007) New Revision: 18485 Log: Bugfix from Atsushi Nemoto: return nonzero error code on failure (without which busybox ping segfaults on error). Broken during locking changes in in svn 16801. Modified: trunk/uClibc/libc/inet/getproto.c Changeset: Modified: trunk/uClibc/libc/inet/getproto.c =================================================================== --- trunk/uClibc/libc/inet/getproto.c 2007-04-17 23:08:20 UTC (rev 18484) +++ trunk/uClibc/libc/inet/getproto.c 2007-04-18 16:26:16 UTC (rev 18485) @@ -195,7 +195,7 @@ rv = 0; DONE: __UCLIBC_MUTEX_UNLOCK(mylock); - return 0; + return rv; } libc_hidden_def(getprotoent_r) From vapier at uclibc.org Wed Apr 18 12:54:28 2007 From: vapier at uclibc.org (vapier at uclibc.org) Date: Wed, 18 Apr 2007 12:54:28 -0700 (PDT) Subject: svn commit: trunk/website/uclibc.org Message-ID: <20070418195428.5333048098@busybox.net> Author: vapier Date: 2007-04-18 12:54:26 -0700 (Wed, 18 Apr 2007) New Revision: 18487 Log: use html entity rather than the ascii value for the mu Modified: trunk/website/uclibc.org/about.html trunk/website/uclibc.org/uClibc-apps.html Changeset: Modified: trunk/website/uclibc.org/about.html =================================================================== --- trunk/website/uclibc.org/about.html 2007-04-18 17:21:28 UTC (rev 18486) +++ trunk/website/uclibc.org/about.html 2007-04-18 19:54:26 UTC (rev 18487) @@ -5,14 +5,14 @@

A C library for embedded Linux

-uClibc (aka ?Clibc/pronounced yew-see-lib-see) is a C library for developing +uClibc (aka µClibc/pronounced yew-see-lib-see) is a C library for developing embedded Linux systems. It is much smaller than the GNU C Library, but nearly all applications supported by glibc also work perfectly with uClibc. Porting applications from glibc to uClibc typically involves just recompiling the source code. uClibc even supports shared libraries and threading. It currently runs on standard Linux and MMU-less (also known as ?Clinux) systems with +href="http://www.uclinux.org">MMU-less (also known as µClinux) systems with support for alpha, ARM, cris, i386, i960, h8300, m68k, mips/mipsel, PowerPC, SH, SPARC, and v850 processors. Modified: trunk/website/uclibc.org/uClibc-apps.html =================================================================== --- trunk/website/uclibc.org/uClibc-apps.html 2007-04-18 17:21:28 UTC (rev 18486) +++ trunk/website/uclibc.org/uClibc-apps.html 2007-04-18 19:54:26 UTC (rev 18487) @@ -17,7 +17,7 @@ - ? C l i b c + µ C l i b c From sjhill at uclibc.org Sat Apr 21 12:42:22 2007 From: sjhill at uclibc.org (sjhill at uclibc.org) Date: Sat, 21 Apr 2007 12:42:22 -0700 (PDT) Subject: svn commit: trunk/uClibc/test/time Message-ID: <20070421194222.1424D48085@busybox.net> Author: sjhill Date: 2007-04-21 12:42:21 -0700 (Sat, 21 Apr 2007) New Revision: 18510 Log: This test needs XLOCALE to work. Modified: trunk/uClibc/test/time/tst-ftime_l.c Changeset: Modified: trunk/uClibc/test/time/tst-ftime_l.c =================================================================== --- trunk/uClibc/test/time/tst-ftime_l.c 2007-04-21 17:28:51 UTC (rev 18509) +++ trunk/uClibc/test/time/tst-ftime_l.c 2007-04-21 19:42:21 UTC (rev 18510) @@ -3,7 +3,7 @@ #include #include #include -#if defined __UCLIBC_HAS_WCHAR__ && defined __UCLIBC_HAS_LOCALE__ +#ifdef __UCLIBC_HAS_XLOCALE__ #include #include From sjhill at uclibc.org Sat Apr 21 12:43:06 2007 From: sjhill at uclibc.org (sjhill at uclibc.org) Date: Sat, 21 Apr 2007 12:43:06 -0700 (PDT) Subject: svn commit: branches/uClibc-nptl/test/time Message-ID: <20070421194306.6967048085@busybox.net> Author: sjhill Date: 2007-04-21 12:43:06 -0700 (Sat, 21 Apr 2007) New Revision: 18511 Log: Merge from trunk. Modified: branches/uClibc-nptl/test/time/tst-ftime_l.c Changeset: Modified: branches/uClibc-nptl/test/time/tst-ftime_l.c =================================================================== --- branches/uClibc-nptl/test/time/tst-ftime_l.c 2007-04-21 19:42:21 UTC (rev 18510) +++ branches/uClibc-nptl/test/time/tst-ftime_l.c 2007-04-21 19:43:06 UTC (rev 18511) @@ -3,7 +3,7 @@ #include #include #include -#if defined __UCLIBC_HAS_WCHAR__ && defined __UCLIBC_HAS_LOCALE__ +#ifdef __UCLIBC_HAS_XLOCALE__ #include #include From aldot at uclibc.org Mon Apr 23 10:01:06 2007 From: aldot at uclibc.org (aldot at uclibc.org) Date: Mon, 23 Apr 2007 10:01:06 -0700 (PDT) Subject: svn commit: trunk/uClibc/libc/inet Message-ID: <20070423170106.28BAC48022@busybox.net> Author: aldot Date: 2007-04-23 10:01:05 -0700 (Mon, 23 Apr 2007) New Revision: 18514 Log: - include stdbool.h Modified: trunk/uClibc/libc/inet/resolv.c Changeset: Modified: trunk/uClibc/libc/inet/resolv.c =================================================================== --- trunk/uClibc/libc/inet/resolv.c 2007-04-21 23:28:03 UTC (rev 18513) +++ trunk/uClibc/libc/inet/resolv.c 2007-04-23 17:01:05 UTC (rev 18514) @@ -150,6 +150,7 @@ #include #include #include +#include #include #include #include From vapier at uclibc.org Mon Apr 23 22:24:09 2007 From: vapier at uclibc.org (vapier at uclibc.org) Date: Mon, 23 Apr 2007 22:24:09 -0700 (PDT) Subject: svn commit: trunk/uClibc/libc/stdlib/malloc Message-ID: <20070424052409.1774D4809E@busybox.net> Author: vapier Date: 2007-04-23 22:24:08 -0700 (Mon, 23 Apr 2007) New Revision: 18515 Log: fix from Bernd Schmidt for realloc shrinkage bug Modified: trunk/uClibc/libc/stdlib/malloc/realloc.c Changeset: Modified: trunk/uClibc/libc/stdlib/malloc/realloc.c =================================================================== --- trunk/uClibc/libc/stdlib/malloc/realloc.c 2007-04-23 17:01:05 UTC (rev 18514) +++ trunk/uClibc/libc/stdlib/malloc/realloc.c 2007-04-24 05:24:08 UTC (rev 18515) @@ -46,6 +46,11 @@ allocation unit (SIZE is already guaranteed to be so).*/ new_size = HEAP_ADJUST_SIZE (new_size + MALLOC_HEADER_SIZE); + if (new_size < sizeof (struct heap_free_area)) + /* Because we sometimes must use a freed block to hold a free-area node, + we must make sure that every allocated block can hold one. */ + new_size = HEAP_ADJUST_SIZE (sizeof (struct heap_free_area)); + MALLOC_DEBUG (1, "realloc: 0x%lx, %d (base = 0x%lx, total_size = %d)", (long)mem, new_size, (long)base_mem, size); From bugs at busybox.net Wed Apr 25 03:41:20 2007 From: bugs at busybox.net (bugs at busybox.net) Date: Wed, 25 Apr 2007 03:41:20 -0700 Subject: [uClibc 0001326]: syscall for socket functions with kernel headers 2.4 Message-ID: The following issue has been SUBMITTED. ====================================================================== http://busybox.net/bugs/view.php?id=1326 ====================================================================== Reported By: Kim Tuan Assigned To: uClibc ====================================================================== Project: uClibc Issue ID: 1326 Category: Architecture Specific Reproducibility: always Severity: minor Priority: normal Status: assigned ====================================================================== Date Submitted: 04-25-2007 03:41 PDT Last Modified: 04-25-2007 03:41 PDT ====================================================================== Summary: syscall for socket functions with kernel headers 2.4 Description: I cross-compile applications for ARM 920T and while executing them I got a "-1 ENOSYS (Function not implemented)" error. strace gives : SYS_281(0x2, 0x2, 0, 0xbffff320, 0x2) = -1 ENOSYS (Function not implemented) It seems that it compiles with wrong values of system call which doesn't correspond to the the specified kernel headers. I'm using linux kernel headers 2.4.31, gcc 3.4.6 and uClibc 0.9.28.3. ====================================================================== Issue History Date Modified Username Field Change ====================================================================== 04-25-07 03:41 Kim Tuan New Issue 04-25-07 03:41 Kim Tuan Status new => assigned 04-25-07 03:41 Kim Tuan Assigned To => uClibc ====================================================================== From bugs at busybox.net Wed Apr 25 08:21:08 2007 From: bugs at busybox.net (bugs at busybox.net) Date: Wed, 25 Apr 2007 08:21:08 -0700 Subject: [uClibc 0001326]: syscall for socket functions with kernel headers 2.4 Message-ID: <0564a78150113cda4808f0c456349521@busybox.net> A NOTE has been added to this issue. ====================================================================== http://busybox.net/bugs/view.php?id=1326 ====================================================================== Reported By: Kim Tuan Assigned To: uClibc ====================================================================== Project: uClibc Issue ID: 1326 Category: Architecture Specific Reproducibility: always Severity: minor Priority: normal Status: assigned ====================================================================== Date Submitted: 04-25-2007 03:41 PDT Last Modified: 04-25-2007 08:21 PDT ====================================================================== Summary: syscall for socket functions with kernel headers 2.4 Description: I cross-compile applications for ARM 920T and while executing them I got a "-1 ENOSYS (Function not implemented)" error. strace gives : SYS_281(0x2, 0x2, 0, 0xbffff320, 0x2) = -1 ENOSYS (Function not implemented) It seems that it compiles with wrong values of system call which doesn't correspond to the the specified kernel headers. I'm using linux kernel headers 2.4.31, gcc 3.4.6 and uClibc 0.9.28.3. ====================================================================== ---------------------------------------------------------------------- Kim Tuan - 04-25-07 08:21 ---------------------------------------------------------------------- What I didn't do is to specify kernel headers path for uclibc. A solution is do a make uclibc-menuconfig and rebuild the entire buildroot. With a 'make clean' followed by a 'make', the cross compiler is properly built and each call of socket functions work. Issue History Date Modified Username Field Change ====================================================================== 04-25-07 03:41 Kim Tuan New Issue 04-25-07 03:41 Kim Tuan Status new => assigned 04-25-07 03:41 Kim Tuan Assigned To => uClibc 04-25-07 08:21 Kim Tuan Note Added: 0002331 ====================================================================== From vapier at uclibc.org Mon Apr 30 14:23:23 2007 From: vapier at uclibc.org (vapier at uclibc.org) Date: Mon, 30 Apr 2007 14:23:23 -0700 (PDT) Subject: svn commit: trunk/uClibc/libc/sysdeps/linux/sh Message-ID: <20070430212323.9778048577@busybox.net> Author: vapier Date: 2007-04-30 14:23:22 -0700 (Mon, 30 Apr 2007) New Revision: 18533 Log: Carmelo AMOROSO writes: running LTP test suite on uClibc-nptl for sh4 I found a bug into pread and pwrite functions. When the offset is negative it is not correctly handled due to a missing shift operation, so it is passed to the syscall as the highest unsigned positive value. Modified: trunk/uClibc/libc/sysdeps/linux/sh/pread_write.c Changeset: Modified: trunk/uClibc/libc/sysdeps/linux/sh/pread_write.c =================================================================== --- trunk/uClibc/libc/sysdeps/linux/sh/pread_write.c 2007-04-29 23:42:54 UTC (rev 18532) +++ trunk/uClibc/libc/sysdeps/linux/sh/pread_write.c 2007-04-30 21:23:22 UTC (rev 18533) @@ -33,7 +33,7 @@ ssize_t __libc_pread(int fd, void *buf, size_t count, off_t offset) { - return(__syscall_pread(fd,buf,count,0,__LONG_LONG_PAIR((off_t)0,offset))); + return(__syscall_pread(fd,buf,count,0,__LONG_LONG_PAIR(offset >> 31,offset))); } weak_alias(__libc_pread,pread) @@ -66,7 +66,7 @@ ssize_t __libc_pwrite(int fd, const void *buf, size_t count, off_t offset) { - return(__syscall_pwrite(fd,buf,count,0,__LONG_LONG_PAIR((off_t)0,offset))); + return(__syscall_pwrite(fd,buf,count,0,__LONG_LONG_PAIR(offset >> 31,offset))); } weak_alias(__libc_pwrite,pwrite)