summaryrefslogtreecommitdiffstats
path: root/libc/misc
Commit message (Collapse)AuthorAgeFilesLines
* time.c, time.h: remove unused hidden strftime/strptimePeter S. Mazinger2011-03-101-6/+6
| | | | Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
* ctype.c, ctype.h: remove commented parts that were banned for removal after ↵Peter S. Mazinger2011-03-101-4/+0
| | | | | | 0.9.31 Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
* _wctype.c, wctype.h: remove unused isw* and wctype_l hidden functionsPeter S. Mazinger2011-03-101-7/+16
| | | | Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
* time.c, wchar.h: remove unused hidden wcsftimePeter S. Mazinger2011-03-101-3/+3
| | | | Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
* ctype.c, _collate.c, str[n]casecmp.c, strlcpy.c: remove unused hidden functionsPeter S. Mazinger2011-03-091-1/+0
| | | | Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
* regcomp.c, aeabi_mb_cur_max.c: use unconditionally MB_CUR_MAX from stdlib.hPeter S. Mazinger2011-03-091-4/+0
| | | | Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
* fnmatch.c: use MB_CUR_MAX from stdlib.h included earlierPeter S. Mazinger2011-03-091-5/+0
| | | | Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
* remove trailing ';' from _syscallX()Peter S. Mazinger2011-03-093-3/+3
| | | | Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
* locale.c: export newlocale only if XLOCALE is definedPeter S. Mazinger2011-03-071-0/+2
| | | | | | | newlocale is used by setlocale, so we need the hidden version even if XLOCALE is not defined Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
* locale.c, locale.h: no need for hidden duplocalePeter S. Mazinger2011-03-071-1/+0
| | | | Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
* Add support for DSBT ELF to ld.soMark Salter2011-03-051-1/+3
| | | | | | | | | | This adds support for DSBT ELF to ld.so. This uses loadmaps like FD-PIC. Some code is added in ld.so to initialize the DSBT tables, and there's also a new target macro FINISH_BOOTSTRAP_RELOC. Signed-off-by: Mark Salter <msalter@redhat.com> Signed-off-by: Aurelien Jacquiot <a-jacquiot@ti.com> Signed-off-by: Bernd Schmidt <bernds@codesourcery.com>
* update some headersPeter S. Mazinger2011-03-031-0/+1
| | | | Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
* initialize 2 variables to get rid of compiler warningPeter S. Mazinger2011-03-031-1/+1
| | | | Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
* Correct ssp codePeter S. Mazinger2011-03-031-18/+7
| | | | | | | | Avoid using strong_alias in ssp, some archs dislike it. Make stack_chk_guard static. Export __stack_smash_handler only if compatibility option is enabled. Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
* add missing prototypesPeter S. Mazinger2011-03-031-2/+5
| | | | | | Add some missing prototypes Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
* add missing prototypesPeter S. Mazinger2011-03-031-0/+1
| | | | | | Add some missing prototypes Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
* syntax fixesPeter S. Mazinger2011-03-031-2/+2
| | | | | | Avoid compile warnings about the use of undefined constants Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
* tempname: fix int precision warningsMike Frysinger2011-02-221-1/+4
| | | | | | | | | | | The printf precision takes an integer, not a size_t. Otherwise we get: libc/misc/internals/tempname.c: In function '___path_search': libc/misc/internals/tempname.c:116: warning: field precision should have type 'int', but argument 3 has type 'size_t' field precision should have type 'int', but argument 5 has type 'size_t' Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* regex: remove set but not used variableBernhard Reutner-Fischer2011-02-141-3/+1
| | | | Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* fix a problem with hidden getutent in non-threaded buildsDenys Vlasenko2011-02-061-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* syslog: fix 'everyone logs with user facility'Roman I Khimov2011-01-111-1/+1
| | | | | | | | | | | | It's been found that on uclibc-based system most of the programs log with 'user' facility despite the calls to openlog() with other facilities explicitly set. Most but not all. Investigating that I've found that the ones logging with proper facilities used LOG_NDELAY in openlog(). The problem is that LogFacility is overwritten in openlog_intern and LOG_USER is passed to it from vsyslog() no matter what the program set with openlog(). Signed-off-by: Roman I Khimov <khimov@altell.ru> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* libc_utmp: Fix getutmp and getutmpx for x86_64Carmelo Amoroso2010-11-281-2/+4
| | | | | | | | | | | | On x86_64, when WORDSIZE_COMPAT32 is enabled, the ut_tv field of 'struct utmp' and 'struct utmpx' are defined as two nested structs instead of being defined as 'struct timeval', so it is not possible to directly assign the two ut_tv values. This patch split the assignment by setting each fields (tv_sec, tv_usec) of the ut_tv filed separately It is als compatible with 'struct timeval' usage. Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
* wchar: bug #1471: fix cornercase in mbrtowcBernhard Reutner-Fischer2010-11-241-0/+2
| | | | Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* parse_config: discard rest of incomplete lineNatanael Copa2010-10-141-0/+7
| | | | | | | | If line is longer then size of given buffer and buffer is not allocated by the config parser itself, then discard rest of line. Signed-off-by: Natanael Copa <natanael.copa@gmail.com> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* config parser: always initialize line pointerNatanael Copa2010-10-141-2/+1
| | | | | | | | We must always initialize line pointer since data pointer might have changed due to a realloc (in getserv.c for example). Signed-off-by: Natanael Copa <natanael.copa@gmail.com> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* config parser: do not assume that realloc return same pointerNatanael Copa2010-10-141-5/+4
| | | | | | | | | | | | We need to update the parser->line pointer on realloc and do not initialize the token array til after the potensial realloc in bb_get_chunk_with_continuation(). While here, also replace a realloc() with malloc() where pointer always is NULL. Signed-off-by: Natanael Copa <natanael.copa@gmail.com> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* misc: utmpx based logging supportSalvatore Cro2010-09-144-0/+115
| | | | | | | | misc: Added support for accessing user accounting database based on utmpx structure. Signed-off-by: Salvatore Cro <salvatore.cro@st.com> Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
* misc: Fix build error about missing PAGE_SIZEAbdoulaye Walsimou Gaye2010-09-061-0/+1
| | | | | | | | | | | | | | | | This patch fixes the following build error: CC libc/misc/internals/__h_errno_location.os CC libc/misc/internals/parse_config.os libc/misc/internals/parse_config.c: In function 'bb_get_chunk_with_continuation': libc/misc/internals/parse_config.c:77: error: 'PAGE_SIZE' undeclared (first use in this function) libc/misc/internals/parse_config.c:77: error: (Each undeclared identifier is reported only once libc/misc/internals/parse_config.c:77: error: for each function it appears in.) make[2]: *** [libc/misc/internals/parse_config.os] Error 1 Signed-off-by: Abdoulaye Walsimou Gaye <awg@embtoolkit.org> Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
* getserv: fix reading services lines w > 80 charsBernhard Reutner-Fischer2010-08-191-4/+7
| | | | | | e.g. getservbyname() Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* config parser: fix memory corruptionTimo Teräs2010-08-061-2/+2
| | | | | | | | | | | | fgets will happily write over allocated area limits. Adjusted the buffer size according to how much is already read. Also increase the maximum default line length, as 80 is slightly small. It might be better if bb_get_chunk_with_continuation would reallocate the line buffer if it was not user given. Signed-off-by: Timo Teräs <timo.teras@iki.fi> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* add config parserBernhard Reutner-Fischer2010-08-052-3/+273
| | | | Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* silence warning about incompatible types with _dl_init_static_tlsBernhard Reutner-Fischer2010-07-271-1/+1
| | | | Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* Fix ctime() standard compliance bugDavid A Ramos2010-07-271-0/+1
| | | | | | | | | | | | | | | | | | | | | 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>
* Revert "don't make __errno_location / __h_errno_location hidden"Austin Foxley2010-07-062-0/+4
| | | | | | | | 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>
* don't make __errno_location / __h_errno_location hiddenPeter Korsgaard2010-07-052-4/+0
| | | | | | | | | | | | | 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>
* more workarounds for GCC PR32219Timo Teräs2010-06-301-2/+2
| | | | | | | | | | 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>
* nptl/errno: Use a separate __errno_location for libpthread.Khem Raj2010-06-301-1/+5
| | | | Signed-off-by: Khem Raj <raj.khem@gmail.com>
* libc: Fix non-NPTL threads buildCarmelo Amoroso2010-06-171-1/+3
| | | | | | | | 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>
* hcreate_r: silence warning in helper funcBernhard Reutner-Fischer2010-06-111-4/+4
| | | | Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* wordexp: silence warningBernhard Reutner-Fischer2010-06-111-1/+2
| | | | Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* static build: define pthreads wrappers only for threaded buildsTimo Teräs2010-05-171-0/+2
| | | | | | | | 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>
* some (all?) archs don't define asm, so use builtin __asm__Austin Foxley2010-05-171-1/+1
| | | | Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
* workaround GCC PR32219Denys Vlasenko2010-05-171-2/+13
| | | | | | | | 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>
* static build: fix internal locking weaks to get pulled in alwaysTimo Teras2010-05-073-41/+35
| | | | | | | | | | | 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>
* time.c: fix unreadable code style: assignments within if(), misplaced commentsDenys Vlasenko2010-04-291-35/+48
| | | | | | No logic changes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* optional /etc/localtime supportDenys Vlasenko2010-04-291-3/+41
| | | | | | | | 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>
* libc/regex: fix internal_function declarationsRoman I Khimov2010-04-271-5/+5
| | | | | | | | | | | | | | 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>
* libc: Remove compiler warning due to old-style function definitionCarmelo Amoroso2010-04-251-57/+27
| | | | Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
* nptl: fix libc internal, dynamically enabled lockingTimo Teräs2010-04-222-0/+41
| | | | | | | | | | | | | | | | | | | | | 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>
* libc: remove libc weak __pthreads_* wrappersTimo Teras2010-04-164-74/+1
| | | | | | | | | | | | | | | | | 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>