summaryrefslogtreecommitdiffstats
path: root/libc
Commit message (Collapse)AuthorAgeFilesLines
* mips/dlfcn.h: Disable RTLD_DEEPBINDKhem Raj2012-01-161-0/+2
| | | | | | RTLD_DEEPBIND is not supported in uclibc Signed-off-by: Khem Raj <raj.khem@gmail.com>
* libc: build abort with unwind-info for backtraceBernhard Reutner-Fischer2012-01-152-0/+4
| | | | | | | If backtrace support is turned on, build raise() and abort() with unwind info (fixup 4c9b7f3c21ff21c199e54bfad2fdf3445fa4573d). Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* libc: allow to backtrace out of abort callCarmelo Amoroso2012-01-132-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Build raise and abort function with dwarf2 info by using -fasynchronous-unwind-tables to make backtrace() working across a call to abort. A scenario where it could be useful is within a signal handler that wants to dump a backtrace when catching some signal (i.e SIGABRT). Without having abort & raise built with DWARF2 information, it is not possible for the libgcc stack unwinder to walk through the call stack out of the abort/raise function. Impacts in terms of size are really limited Current text data bss dec hex filename 164 0 0 164 a4 ./libpthread/nptl/sysdeps/unix/sysv/linux/raise.os 164 0 0 164 a4 ./libpthread/nptl/sysdeps/unix/sysv/linux/raise.oS 220 24 4 248 f8 ./libc/stdlib/abort.os With (-fasynchronous-unwind-tables) text data bss dec hex filename 216 0 0 216 d8 ./libpthread/nptl/sysdeps/unix/sysv/linux/raise.os 216 0 0 216 d8 ./libpthread/nptl/sysdeps/unix/sysv/linux/raise.oS 280 24 4 308 134 ./libc/stdlib/abort.os Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com> Acked-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* getpass: s/sizeof(buf)-1/sizeof(buf)/ in fgetsDenys Vlasenko2012-01-011-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* getpass: several fixesDenys Vlasenko2011-12-231-27/+19
| | | | | | | | | | fixes bogus fgets error check fixes bogus strlen() < 0 check switches off buffering regardless of tcgetattr() success prints newline even on error or if there was no '\n' on input uses sizeof(buf) instead of PWD_BUFFER_SIZE Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* x86_64: add PLT bypass for __sigsetjmpMike Frysinger2011-12-033-2/+7
| | | | | | | | | | | | | The current x86_64 setjmp helpers incur a reloc, so fix that up. $ readelf -r lib/libc.so.0 ... Relocation section '.rela.plt' at offset 0xb058 contains 10 entries: Offset Info Type Sym. Value Sym. Name + Addend 000000236010 02a400000007 R_X86_64_JUMP_SLO 000000000000b3c4 __sigsetjmp + 0 ... Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* getutid: add a hidden defMike Frysinger2011-12-031-0/+1
| | | | | | | | | | | | | | The pututline func calls getutid, so add a hidden def for it to avoid plt relocs: $ readelf -r lib/libc.so.0 ... Relocation section '.rela.plt' at offset 0xb058 contains 11 entries: Offset Info Type Sym. Value Sym. Name + Addend 000000236000 01cf00000007 R_X86_64_JUMP_SLO 00000000000190ab getutid + 0 ... Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* make ARRAY_SIZE commonly available internallyMike Frysinger2011-11-271-3/+0
| | | | | | | Some places have opencoded the ARRAY_SIZE macro, so move it to a global internal location so other places can leverage it. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* buildsys: s/CROSS/CROSS_COMPILE/gCarmelo Amoroso2011-11-251-3/+3
| | | | | | | | Use CROSS_COMPILE instead of CROSS as other projects are doing (i.e. kernel, busybox, buildroot). CROSS is still supported for backward compatibility only Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
* libc: do not rely upon ulimit kernel syscall.Carmelo Amoroso2011-11-231-8/+0
| | | | | | | | | | | | On several architectures __NR_ulimit syscall number is currently defined but it is remapped onto sys_ni_syscall, while on other architectures they are not longer defined. So use {get,set}rlimit only to implement ulimit interface. It fixes LTP ulimit01 test case. Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com> Acked-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* stdio: add support for "e" flag with fopen()Mike Frysinger2011-11-201-1/+8
| | | | | | | Support this useful glibc extension for optionally setting O_CLOEXEC on fopen streams. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* misc: hide __gen_tempnameBernhard Reutner-Fischer2011-11-172-4/+4
| | | | | | fix signed vs. unsigned comparison warnings while at it Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* stdio: hide _stdio_validate_FILEBernhard Reutner-Fischer2011-11-172-2/+2
| | | | Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* regex_old: make some internal helpers staticBernhard Reutner-Fischer2011-11-171-5/+5
| | | | Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* inet: hide relocationsBernhard Reutner-Fischer2011-11-171-1/+2
| | | | Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* unistd: hide relocationsBernhard Reutner-Fischer2011-11-171-0/+4
| | | | Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* resolv: hide relocationsBernhard Reutner-Fischer2011-11-171-0/+7
| | | | Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* Add a C6X-specific ipc.h.Bernd Schmidt2011-11-141-0/+55
| | | | Signed-off-by: Bernd Schmidt <bernds@codesourcery.com>
* libc: flesh out linux scheduler functionsHenning Heinold2011-11-079-17/+277
| | | | | | | Most stuff was taken from the eglibc. Signed-off-by: Henning Heinold <heinold@inf.fu-berlin.de> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* ldso: support RTLD_NOLOADTimo Teräs2011-11-071-2/+2
| | | | | | | | So application query if specified module is loaded or not with dlopen. Signed-off-by: Timo Teräs <timo.teras@iki.fi> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* stdlib: add qsort_rBernhard Reutner-Fischer2011-11-073-6/+26
| | | | | | GNU extension like qsort but takes a 3 parameter comparision function. Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* powerpc: Fix typo in clone()Bernhard Reutner-Fischer2011-11-041-1/+1
| | | | | | Thanks to strauman at slac stanford edu for noticing Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* Add stub for eventfd.Jean-Christian de Rivaz2011-11-041-0/+4
| | | | | | | Warn if the enventfd() function is not implemented. Signed-off-by: Jean-Christian de Rivaz <jc@eclis.ch> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* libm: implement a generic sincos().William Pitcock2011-11-041-1/+1
| | | | | | | We already provide sincos() on some archs, so we should ship a generic version. Signed-off-by: William Pitcock <nenolod@dereferenced.org> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* setegid: use setresgid conditionallyBernhard Reutner-Fischer2011-11-021-0/+6
| | | | Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* stubs: remove leftover undefsBernhard Reutner-Fischer2011-11-021-61/+0
| | | | Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* stubs: handle linux module functionsBernhard Reutner-Fischer2011-11-022-4/+5
| | | | Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* stubs: handle linux-specificBernhard Reutner-Fischer2011-11-022-19/+184
| | | | Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* stubs: fix inverted socket logicBernhard Reutner-Fischer2011-11-021-19/+19
| | | | Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* stubs: undef linux specific unless they were asked forBernhard Reutner-Fischer2011-11-021-0/+34
| | | | Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* Add eventfd support.Jean-Christian de Rivaz2011-10-313-1/+68
| | | | | | | | | | | | Hello, I whould like to share this simple patch that add the eventfd call to uClibc. Please review so it can be accepted to be merged. Jean-Christian Signed-off-by: Jean-Christian de Rivaz <jc@eclis.ch> Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
* sparc: fix build for linuxthreads.oldRob Landley2011-10-271-1/+1
| | | | | | | | | sparc target has assembly implementations of clone.S that doesn't get used, and thus the build breaks. Also, sparc is missing a header file in pthreads.old that exists in pthreads.new. Signed-off-by: Rob Landley <rob@landley.net> Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
* sh: fix build for SH in !NPTL caseRob Landley2011-10-271-1/+1
| | | | | Signed-off-by: Rob Landley <rob@landley.net> Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
* resolv: fix memory leakBernhard Reutner-Fischer2011-10-211-0/+2
| | | | | | | | Timothy Holdener writes: small memory leak in __dns_lookup() when the A record in the DNS answer is preceded by one or more CNAME records. Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* resolv: commentary typo fixBernhard Reutner-Fischer2011-10-201-1/+1
| | | | Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* gethostbyname_r: set correct h_errno upon failureBernhard Reutner-Fischer2011-10-201-0/+1
| | | | | | | | | | | | | | | previously gethostbyname_r(ipv6.google.com);herror("ERROR:") gave Answer name = |ipv6.google.com| Answer type = |5| herrno=1 h_errno=0 ERROR:: Error 0 herrno=1 h_errno=1 ERROR:: Unknown host Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* resolv: fix compilationBernhard Reutner-Fischer2011-10-201-2/+2
| | | | Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* libc: fix daylight saving time handlingGuillaume Bourcier2011-10-121-1/+1
| | | | | | | | | | | | | The algorithm computing daylight saving time incorrectly adds a day for each month after January for leap years. The clock shift from/to DST can be delayed if the last Sunday of a transition month is exactly seven days before the first of the following month. This change adds a day for the February month only. Signed-off-by: Guillaume Bourcier <guillaumebourcier@free.fr> Signed-off-by: Richard Braun <rbraun@sceen.net> Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
* microblaze mmu/elf/shared lib supportRyan Flux2011-10-063-1/+40
| | | | | | | | | microblaze can either be with mmu or without If with, use elf rather than flat, and support shared libs Signed-off-by: Ryan Flux <ryan.flux@emsolutions.com.au> Signed-off-by: Steve Bennett <steveb@workware.net.au> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* microblaze linux has no SDA supportSteve Bennett2011-10-062-8/+0
| | | | | | | | | The linker does not set up the Small Data Area symbols, _SDA_BASE_ and _SDA2_BASE_ so don't try to resolve them Signed-off-by: Ryan Flux <ryan.flux@emsolutions.com.au> Signed-off-by: Steve Bennett <steveb@workware.net.au> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* microblaze can be either big or little endianSteve Bennett2011-10-061-1/+8
| | | | | Signed-off-by: Steve Bennett <steveb@workware.net.au> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* Use the generic bits/select.h for microblazeSteve Bennett2011-10-061-58/+0
| | | | | | | This avoids warnings about type-punned pointers Signed-off-by: Steve Bennett <steveb@workware.net.au> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* Defeat compiler optimization which assumes function addresses are never NULLDenys Vlasenko2011-09-152-20/+42
| | | | | | | | | | | | | From email: A warning for people who can be hit by the same or similar issue: gcc 4.1.2 with -march=i486 here with -Os and even with -O2 or -O is "optimizing away" the check if (_stdio_term) in libc/stdlib/_atexit.c which results in a "call 0" and a segfault at exit if you do not happen to link in stdio. Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* resolv: simple optimizations and style/readability fixesDenys Vlasenko2011-09-101-118/+107
| | | | | | | | | | text data bss dec hex filename - 2915 0 0 2915 b63 libc/inet/ns_name_old.o + 2656 0 0 2656 a60 libc/inet/ns_name.o - 958 0 0 958 3be libc/inet/ns_parse_old.o + 898 0 0 898 382 libc/inet/ns_parse.o Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* inet: build all res_* and ns_* functions conditionallyDaniel Mack2011-08-261-3/+2
| | | | | | | | | | | | This patch changes the build system so that all DNS resolver related functions (ie, those starting with dn_, ns_ and res_) are only built if UCLIBC_HAS_RESOLVER_SUPPORT is set. This means that the libc will lack support for things that existed in the library before unless this new config option is set. On the other hand, if users really need support for resolver functions, they now get a more complete set, and the library is smaller than before it is deselected. Signed-off-by: Daniel Mack <zonque@gmail.com>
* inet/resolv: add res_ninit and res_ncloseDaniel Mack2011-08-261-13/+128
| | | | | | | Some reordering of existing functions was necessary in order to provide this functionality. Signed-off-by: Daniel Mack <zonque@gmail.com>
* inet/resolv: add res_mkqueryDaniel Mack2011-08-263-2/+124
| | | | Signed-off-by: Daniel Mack <zonque@gmail.com>
* inet/resolv: add ns_initparse, ns_parserr, ns_skiprr and ns_msg_getflagDaniel Mack2011-08-263-1/+204
| | | | | | There are build 'ifdef L_ns_parse'. Signed-off-by: Daniel Mack <zonque@gmail.com>
* inet/resolv: add dn_skipname and ns_name_skipDaniel Mack2011-08-261-0/+52
| | | | | | One uses the other, so add them in one go. Signed-off-by: Daniel Mack <zonque@gmail.com>
* inet/resolv: Add dn_compDaniel Mack2011-08-261-1/+14
| | | | Signed-off-by: Daniel Mack <zonque@gmail.com>