summaryrefslogtreecommitdiff
path: root/libc
AgeCommit message (Collapse)Author
2012-03-25microblaze: add sys/user.hSteve Bennett
A microblaze-specific sys/user.h is needed for (e.g.) strace, so use this version from glibc. Signed-off-by: Steve Bennett <steveb@workware.net.au> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-03-11__stdio_WRITE: make code more readable. No code changesDenys Vlasenko
Pulled assignments out of ifs. do {...} while (1); is a weird method of writing "loop forever", thus rewrote it. No code changes: objdump output is the same. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2012-02-13arm: Do not use 'sed -r' to calculate IS_EABIKhem Raj
-r is not available on BSD sed so to keep compatibility avoid using it. Signed-off-by: Khem Raj <raj.khem@gmail.com>
2012-02-07inet:rpc: fix authnone_marshal in multithreading contextCarmelo Amoroso
This is a port of glibc's fix by Zack Weinberg as reported in http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=142312, and discussed in http://sourceware.org/ml/libc-alpha/2002-04/msg00069.html and following. Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
2012-02-05lstat/stat/fstat: Use 64bit version of syscall if availableKhem Raj
This is needed for stat'ing loop devices > 255 since otherwise kernel returns EOVERFLOW becasue it needs st_rdev/st_dev to be larger than 16bits but in kernel it uses __old_kernel_stat for stat syscall which has st_rdev/st_dev as unsigned short Add a testcase Signed-off-by: Khem Raj <raj.khem@gmail.com>
2012-02-05Declare __err and pass it to INTERNAL_SYSCALL_NCS so subsequent macros can ↵Khem Raj
use it Signed-off-by: Khem Raj <raj.khem@gmail.com>
2012-01-29tmpnam, tempnam are obsolete in SUSV4Bernhard Reutner-Fischer
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2012-01-29handle signal-OBXSI.SUSv4.symsBernhard Reutner-Fischer
A couple of sig functions are obsolete in SUSv4. Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2012-01-28*: if !HAS_THREADS strong alias sigactionBernhard Reutner-Fischer
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2012-01-28buildsys: fixup sigaction handlingBernhard Reutner-Fischer
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2012-01-27libc_arm: avoid multiple version of __aeabi_unwind_cpp_pr dummy codeCarmelo Amoroso
Do not pollute libraries with its own implementation of __aeabi_unwind_cpp_pr1 code. Just add it to uclibc_nonshared.a archive and share it. This fixes build issue with static linking of application due to multiple symbol definition in libgcc_eh-a and libpthread.a or librt.a Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
2012-01-26*: silence some warningsBernhard Reutner-Fischer
warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement] Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2012-01-26syscall: flag ia64 syscall error path as unlikelyBernhard Reutner-Fischer
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2012-01-26arm: tweak commentBernhard Reutner-Fischer
harmless copy'n paste error Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2012-01-23libc: fix signal handling in system()Richard Braun
When built without NPTL support (or for a sparc target), the system() function doesn't conform to its specification. Namely, it uses signal() to install/save/restore signal handlers, which may break applications using custom handlers installed with sigaction(). In addition, it resets the SIGCHLD handler to SIG_DFL instead of blocking the signal, which may result in "lost" signals if a custom handler was installed. Fix system() by replacing uses of signal() with appropriate calls to sigaction() and sigprocmask(). Signed-off-by: Richard Braun <rbraun@sceen.net> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-01-18i386/sigaction.c: slightly more readable form of [rt_]sigreturn definitionsDenys Vlasenko
No code changes Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2012-01-18stubs: mark stubs as usedBernhard Reutner-Fischer
Avoids warning from -Wunused-function about the alias target that is only used at link-time. Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2012-01-16mips/dlfcn.h: Disable RTLD_DEEPBINDKhem Raj
RTLD_DEEPBIND is not supported in uclibc Signed-off-by: Khem Raj <raj.khem@gmail.com>
2012-01-15libc: build abort with unwind-info for backtraceBernhard Reutner-Fischer
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>
2012-01-13libc: allow to backtrace out of abort callCarmelo Amoroso
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>
2012-01-01getpass: s/sizeof(buf)-1/sizeof(buf)/ in fgetsDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-12-23getpass: several fixesDenys Vlasenko
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>
2011-12-03x86_64: add PLT bypass for __sigsetjmpMike Frysinger
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>
2011-12-03getutid: add a hidden defMike Frysinger
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>
2011-11-27make ARRAY_SIZE commonly available internallyMike Frysinger
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>
2011-11-25buildsys: s/CROSS/CROSS_COMPILE/gCarmelo Amoroso
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>
2011-11-23libc: do not rely upon ulimit kernel syscall.Carmelo Amoroso
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>
2011-11-20stdio: add support for "e" flag with fopen()Mike Frysinger
Support this useful glibc extension for optionally setting O_CLOEXEC on fopen streams. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-11-17misc: hide __gen_tempnameBernhard Reutner-Fischer
fix signed vs. unsigned comparison warnings while at it Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2011-11-17stdio: hide _stdio_validate_FILEBernhard Reutner-Fischer
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2011-11-17regex_old: make some internal helpers staticBernhard Reutner-Fischer
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2011-11-17inet: hide relocationsBernhard Reutner-Fischer
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2011-11-17unistd: hide relocationsBernhard Reutner-Fischer
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2011-11-17resolv: hide relocationsBernhard Reutner-Fischer
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2011-11-14Add a C6X-specific ipc.h.Bernd Schmidt
Signed-off-by: Bernd Schmidt <bernds@codesourcery.com>
2011-11-07libc: flesh out linux scheduler functionsHenning Heinold
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>
2011-11-07ldso: support RTLD_NOLOADTimo Teräs
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>
2011-11-07stdlib: add qsort_rBernhard Reutner-Fischer
GNU extension like qsort but takes a 3 parameter comparision function. Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2011-11-04powerpc: Fix typo in clone()Bernhard Reutner-Fischer
Thanks to strauman at slac stanford edu for noticing Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2011-11-04Add stub for eventfd.Jean-Christian de Rivaz
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>
2011-11-04libm: implement a generic sincos().William Pitcock
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>
2011-11-02setegid: use setresgid conditionallyBernhard Reutner-Fischer
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2011-11-02stubs: remove leftover undefsBernhard Reutner-Fischer
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2011-11-02stubs: handle linux module functionsBernhard Reutner-Fischer
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2011-11-02stubs: handle linux-specificBernhard Reutner-Fischer
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2011-11-02stubs: fix inverted socket logicBernhard Reutner-Fischer
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2011-11-02stubs: undef linux specific unless they were asked forBernhard Reutner-Fischer
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2011-10-31Add eventfd support.Jean-Christian de Rivaz
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>
2011-10-27sparc: fix build for linuxthreads.oldRob Landley
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>
2011-10-27sh: fix build for SH in !NPTL caseRob Landley
Signed-off-by: Rob Landley <rob@landley.net> Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>