summaryrefslogtreecommitdiff
path: root/libc/misc
AgeCommit message (Collapse)Author
2010-07-27silence warning about incompatible types with _dl_init_static_tlsBernhard Reutner-Fischer
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2010-07-27Fix ctime() standard compliance bugDavid A Ramos
fixes issue2209: ctime() was updated in 0.9.31 to call localtime_r() instead of localtime() to avoid using a static buffer. Unfortunately, this change replaces the static buffer (which is zeroed out on initialization) with an uninitialized local buffer. In the common case, this has no effect. However, with a sufficiently large time_t value, the value returned differs from that returned by asctime(localtime(t)), and thus violates the ANSI/ISO standard. An example input is (on a 64-bit machine): time_t t = 0x7ffffffffff6c600; Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2010-07-06Revert "don't make __errno_location / __h_errno_location hidden"Austin Foxley
This reverts commit 0d6ee549bc86fd330672a79d9a87d2c3825eea67. We need to find a solution that will work in shared and static libraries Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
2010-07-05don't make __errno_location / __h_errno_location hiddenPeter Korsgaard
Closes #2089 (https://bugs.busybox.net/show_bug.cgi?id=2089) __errno_location / __h_errno_location access has to go through the PLT like malloc/free, so the linuxthread variants gets used instead when compiling with -pthread. Based on http://github.com/mat-c/uClibc/commit/328d392c54aa5dc2b8e7f398a419087de497de2b Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk> Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
2010-06-30more workarounds for GCC PR32219Timo Teräs
Commit 2e53dd645d5348f207cec7f8595969dc566c5a55 workarounds GCC bug when accessing _locale_init and _stdio_init. We need the same fix for __errno_location and __h_errno_location otherwise we crash calling null with static and non-threaded builds. Signed-off-by: Timo Teräs <timo.teras@iki.fi> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2010-06-30nptl/errno: Use a separate __errno_location for libpthread.Khem Raj
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2010-06-17libc: Fix non-NPTL threads buildCarmelo Amoroso
This patch fixes some issues building uclibc with linuxthreads, that seem to have been introduced by the NPTL changes. Signed-off-by: Andrew Stubbs <ams@codesourcery.com> Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
2010-06-11hcreate_r: silence warning in helper funcBernhard Reutner-Fischer
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2010-06-11wordexp: silence warningBernhard Reutner-Fischer
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2010-05-17static build: define pthreads wrappers only for threaded buildsTimo Teräs
Otherwise we get compiler errors due to undefined prototypes as noticed by Denys. Signed-off-by: Timo Teräs <timo.teras@iki.fi> Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
2010-05-17some (all?) archs don't define asm, so use builtin __asm__Austin Foxley
Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
2010-05-17workaround GCC PR32219Denys Vlasenko
we ended up calling 0 Fixes bug #1033 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2010-05-07static build: fix internal locking weaks to get pulled in alwaysTimo Teras
Linker is smart and does not pull in weaks.os, ever. This happens because that compilation unit does not get strong references and ld eliminates dead code. We really need the weaks for static build in a compilation unit that is always there, otherwise it won't work. Signed-off-by: Timo Teras <timo.teras@iki.fi> Acked-by: Roman I Khimov <khimov@altell.ru> Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
2010-04-29time.c: fix unreadable code style: assignments within if(), misplaced commentsDenys Vlasenko
No logic changes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-04-29optional /etc/localtime supportDenys Vlasenko
This patch teaches uclibc to use /etc/localtime. This is possible since recent TZif2 file format contains TZ-like ASCII string at the end. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-04-27libc/regex: fix internal_function declarationsRoman I Khimov
Build failed with | In file included from libc/misc/regex/regex.c:59: | libc/misc/regex/regexec.c:315: error: conflicting types for 're_search_2_stub' | libc/misc/regex/regexec.c:44: note: previous declaration of 're_search_2_stub' was here | libc/misc/regex/regexec.c:358: error: conflicting types for 're_search_stub' | libc/misc/regex/regexec.c:49: note: previous declaration of 're_search_stub' was here .... etc Signed-off-by: Roman I Khimov <khimov@altell.ru> Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
2010-04-25libc: Remove compiler warning due to old-style function definitionCarmelo Amoroso
Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
2010-04-22nptl: fix libc internal, dynamically enabled lockingTimo Teräs
Final iteration to fix libc internal locking if libpthread is pulled in by dlopen call (directly or indirectly). We cannot really use the weak symbol trick for shared build, since the symbols won't get refreshed if libpthread is pulled in dynamically. In glibc, they have #ifdef SHARED magic to either use pthread_functions table, or weaks. But as we shared object files with both builds, this does not sounds good either. The reintroduces the libc weaks.c, but uses them now only with static build. For dynamic build, we still use the symbols with same name, but provide weaks in forward.c so they end up dereferencing the pthread_functions table indirectly if we are not linked to libpthread. Mutex initialization is hard coded as inline, as it needs to happen even if libpthread is not initially loaded. Signed-off-by: Timo Teräs <timo.teras@iki.fi> Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
2010-04-16libc: remove libc weak __pthreads_* wrappersTimo Teras
It is not possible to override for libpthread to override the weak libc definitions. This has never worked in uclibc, and does no longer work in glibc either (unless you use LD_DYNAMIC_WEAK). The proper thing to do is have weak prototypes in libc, and definitions in libpthread only. This way libc runs even if those functions are not defined, but just needs to protect against the NULL values (done by implementing __uclibc_maybe_call). This fix the problems if libc is linked before libpthread or if libpthread is pulled by a dependency library. Signed-off-by: Timo Teras <timo.teras@iki.fi> Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
2010-04-12libc_regex: __libc_lock primitives are actually available on uClibcCarmelo Amoroso
__libc_lock primitives are actually available on uClibc when threading support is enable, so in this case they can be used. It also fixes the following compiler warnings: In file included from libc/misc/regex/regex.c:55: libc/misc/regex/regex_internal.h:49:1: warning: "__libc_lock_define" redefined [SNIP] libc/misc/regex/regex_internal.h:50:1: warning: "__libc_lock_init" redefined [SNIP] libc/misc/regex/regex_internal.h:51:1: warning: "__libc_lock_lock" redefined [SNIP] libc/misc/regex/regex_internal.h:52:1: warning: "__libc_lock_unlock" redefined Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
2010-04-06Merge commit 'origin/master' into nptlAustin Foxley
Conflicts: libc/misc/utmp/utent.c libc/sysdeps/linux/i386/bits/syscalls.h Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
2010-04-05utent: do not create extra static functions if !THREADSDenys Vlasenko
text data bss dec hex filename 547 8 384 939 3ab libc/misc/utmp/utent.o 519 8 384 911 38f libc/misc/utmp/utent.o Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-04-05regex_old: convert static flag variable to smallintDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-04-05getutid is not used internally, removing hidden_protoDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-04-02Merge commit 'origin/master' into nptlAustin Foxley
Conflicts: Makefile.in extra/Configs/Config.in libc/sysdeps/linux/common/bits/kernel-features.h libc/sysdeps/linux/common/poll.c libc/sysdeps/linux/common/sysdep.h libc/sysdeps/linux/sh/sysdep.h Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
2010-03-25prettify make cleanBernhard Reutner-Fischer
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2010-02-11libc: build tsd only when tls is enabledAustin Foxley
Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
2010-02-05Merge commit 'origin/master' into nptlAustin Foxley
Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
2010-02-03__uClibc_main: use __pagesize to protect against recursionBernhard Reutner-Fischer
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2010-02-02remove two checks for gettimeofday errorDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-02-01Merge commit 'origin/master' into nptlKhem Raj
Conflicts: libc/stdlib/Makefile.in Signed-off-by: Khem Raj <raj.khem@gmail.com>
2010-02-01errno: hide __libc_resp, __libc_errno, and __libc_h_errnoKhem Raj
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2010-01-25Merge branch 'master' into nptlCarmelo Amoroso
Conflicts: libc/inet/Makefile.in libc/inet/hostid.c Synchronise nptl branch with master branch @ c4b750195714ec7c10aa4de15610c5aae0751c1c Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
2010-01-24wchar.c: fix indentationDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-01-23silence some warnings about unused paramsBernhard Reutner-Fischer
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2010-01-21wordexp: silence shadow warningBernhard Reutner-Fischer
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> (cherry picked from commit 831ea78623556cbfae002477afc6256cacaaf2c6) Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
2010-01-21ctime: do not use static struct tm bufferDenys Vlasenko
text data bss dec hex filename - 19 0 0 19 13 libc/misc/time/ctime.o + 25 0 0 25 19 libc/misc/time/ctime.o Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com> (cherry picked from commit 957e238614326198452b53498ae98e546fce7366) Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
2010-01-21wordexp: silence shadow warningBernhard Reutner-Fischer
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2010-01-09ctime: do not use static struct tm bufferDenys Vlasenko
text data bss dec hex filename - 19 0 0 19 13 libc/misc/time/ctime.o + 25 0 0 25 19 libc/misc/time/ctime.o Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-12-17check if USE_TLS is defined before useHans-Christian Egtvedt
This patch will convert all the #ifdef USE_TLS and #if USE_TLS to #if defined(USE_TLS) && USE_TLS. By checking if the USE_TLS is defined before checking its value will result in correct behavior for architectures not defining this config symbol. Signed-off-by: Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com> Acked-by: Carmelo AMOROSO <carmelo.amoroso@st.com>
2009-12-17check if USE_TLS is defined before useHans-Christian Egtvedt
This patch will convert all the #ifdef USE_TLS and #if USE_TLS to #if defined(USE_TLS) && USE_TLS. By checking if the USE_TLS is defined before checking its value will result in correct behavior for architectures not defining this config symbol. Signed-off-by: Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com> Acked-by: Carmelo AMOROSO <carmelo.amoroso@st.com>
2009-12-15Merge remote branch 'origin/master' into nptlAustin Foxley
Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
2009-12-13syslog: use send(MSG_NOSIGNAL) instead of write, thus no need to handle SIGPIPEDenys Vlasenko
Size changes by this and previous change: text data bss dec hex filename 1151 13 2 1166 48e libc/misc/syslog/syslog.o 1093 10 2 1105 451 libc/misc/syslog/syslog.o 1047 10 2 1059 423 libc/misc/syslog/syslog.o Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-12-13syslog: fix openlog(xx, LOG_KERN) and optimize a bitDenys Vlasenko
The fix: logfac == 0 in openlog(xx, logfac) is allowed now. Corresponding internal openlog() call in vsyslog() uses explicit LOG_USER in order to set it as a default facility. Optimizations: mylock is not recursive now, since a single intenal call of openlog is converted to a call to openlog_internal which assumes that lock is already taken. No recursive locking is possible now. LogFacility is reduced to byte. cache static LogFile in auto variable fd (smaller code). vsyslog with bogus pri parameter wouldn't lock/unlock and mess with signals - it will just return at once. pass NULL as ident string in internal openlog call - same effect as passing LogTag but smaller code. comment out "if (LogTag)" checks - it is never NULL. use the same struct sigaction for setting new sigaction and for saving old one - saves ~32 bytes of stack. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-12-11get x86_64 nptl buildingAustin Foxley
Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
2009-11-27define local stack_chk_guard for nptlNatanael Copa
Signed-off-by: Natanael Copa <natanael.copa@gmail.com> Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
2009-11-22Merge remote branch 'origin/master' into nptl_mergeAustin Foxley
Conflicts: Rules.mak libc/misc/sysvipc/msgq.c test/Rules.mak Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
2009-11-20__assert: include unistd.h for smallintBernhard Reutner-Fischer
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2009-11-19msgrcv is of type ssize_tPeter S. Mazinger
Signed-off-by: Peter S. Mazinger <ps.m@gmx.net> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2009-11-19assert: make linenumber unsignedPeter S. Mazinger
Move attribute_noreturn to header. Signed-off-by: Peter S. Mazinger <ps.m@gmx.net> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>