summaryrefslogtreecommitdiffstats
path: root/libc
Commit message (Collapse)AuthorAgeFilesLines
...
* sparc: check for log double support in gccKonrad Eisele2010-12-271-0/+6
| | | | | | | | | To compile the quad float emulation library gcc needs __LONG_DOUBLE_128__ macro defined. Check first, if not supported then revert to the qp_ops.c stubs Signed-off-by: Konrad Eisele <konrad@gaisler.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
* libm_sh: add optimised assembly implementation of lroundf and lrintfChristian Bruel2010-12-171-0/+1
| | | | | | | | | | * libc/sysdeps/linux/sh/sysdep.h: Add LOCAL macro * libm/sh/sh4/Makefile.arch: Include asm source in the build * libm/sh/sh4/s_lrintf.S [NEW]: optimised asm lrintf * libm/sh/sh4/s_lroundf.S [NEW]: optimised asm lroundf Signed-off-by: Christian Bruel <christian.bruel@st.com> Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
* sh_fpu: Do not allow inclusion of fpu_control on not SH4 coreCarmelo Amoroso2010-12-151-1/+3
| | | | | | | Instead of emitting a warning even when compiling for SH4, stop compilation with an #error directive when not on SH4 core. Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
* sh: fix memcpy saving/restoring FR12-FR15 registersGiuseppe Cavallaro2010-12-141-3/+15
| | | | | | | | | | | | This patch fixes a bug in the memcpy that doesn't save/restore the FR12-FR15 registers (callee save registers in ST40 ABI) while copying many cache lines with FPU in single paired precision mode and by using all FPU registers (DR and XD). Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com> Reviewed-by: Carmelo Amoroso <carmelo.amoroso@st.com> Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
* libc: fix strtoqNatanael Copa2010-12-011-0/+3
| | | | | | | | strtoq should always return a quad_t and be an alias of strtol on 64 bit and strtoll on 32 bit. Signed-off-by: Natanael Copa <natanael.copa@gmail.com> 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>
* libc: silence warningBernhard Reutner-Fischer2010-11-241-0/+1
| | | | | | about implicit declaration of memset in system() Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.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>
* resolv.c fails for /etc/hosts lookupsPhilip Nye2010-11-231-8/+12
| | | | | | | | | | | | Patch attached: Fix a bug in offset calculations when parsing /etc/hosts in resolv.c. Formerly a miscalculation meant that having found the correct line, the code was trashing its own result data. Signed-off-by: Philip Nye <philipn@engarts.com> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* Adding quad float gcc intrinsic implementation for SPARCAustin Foxley2010-11-1841-2/+7220
| | | | | | | | | Sparc-Gcc generates q_xxx intrinsic calls for quad float ("long double") code. The routines from glibc's glibc-2.9/sysdeps/sparc/sparc32/soft-fp/* where taken and ported to uclibc. Signed-off-by: Konrad Eisele <konrad@gaisler.com> Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
* microblaze: build infrastructureSteven J. Magnani2010-11-102-62/+34
| | | | | | | Fix Microblaze config and makefiles. Signed-off-by: Steven J. Magnani <steve@digidescorp.com> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* microblaze: thread supportSteven J. Magnani2010-11-101-0/+145
| | | | | | | Header files needed to build linuxthreads.old for microblaze. Signed-off-by: Steven J. Magnani <steve@digidescorp.com> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* microblaze: optimized memcpy/memmoveSteven J. Magnani2010-11-103-0/+687
| | | | | | | Port optimized memcpy/memmove from the kernel. Signed-off-by: Steven J. Magnani <steve@digidescorp.com> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* microblaze: misc headersSteven J. Magnani2010-11-104-17/+71
| | | | | | | Other header files for uClibc compilation. Signed-off-by: Steven J. Magnani <steve@digidescorp.com> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* microblaze: kernel headersSteven J. Magnani2010-11-105-64/+72
| | | | | | | Sync kernel header definitions with those used in recent mainline kernels. Signed-off-by: Steven J. Magnani <steve@digidescorp.com> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* microblaze: Restore soft-floatSteven J. Magnani2010-11-102-0/+225
| | | | | | | Software floating point for microblaze. Signed-off-by: Steven J. Magnani <steve@digidescorp.com> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* microblaze: vfork/clone interfaceSteven J. Magnani2010-11-102-52/+49
| | | | | | | | Fix the microblaze vfork() and clone() implementations. Add support for clone2(). Signed-off-by: Steven J. Magnani <steve@digidescorp.com> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* microblaze: syscall interfaceSteven J. Magnani2010-11-102-57/+48
| | | | | | | | | Fix the microblaze syscall interface. Recent mainline kernels no longer carry userland code to invoke syscalls and microblaze can use the uClibc generic code. Signed-off-by: Steven J. Magnani <steve@digidescorp.com> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* microblaze: Fix crt bootstrapSteven J. Magnani2010-11-103-0/+147
| | | | | | | | | | | Rework crt bootstrap to work with the new __uClibc_main(), and hardwire crt init/fini code since the awk approach to generating it on the fly doesn't work for microblaze. The output from the gcc 4.1.2 compiler is scrambled so that the tags expected by the awk script to bracket the init/fini entry and exit code no longer do. Signed-off-by: Steven J. Magnani <steve@digidescorp.com> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* microblaze: Fix setjmp/longjmpSteven J. Magnani2010-11-103-39/+50
| | | | | | | Some state and registers are missing from setjmp/longjmp handling. Signed-off-by: Steven J. Magnani <steve@digidescorp.com> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* libm: improve readability of math.h; expand comments and docsDenys Vlasenko2010-10-313-9/+14
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* sleep: include Linus' email in the commentDenys Vlasenko2010-10-301-5/+21
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* sleep: document testing result on 2.4.x kernelsDenys Vlasenko2010-10-291-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* sleep: add comment with test program for SIG_IGNed SIGCHLDDenys Vlasenko2010-10-291-5/+38
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Fix msync() redefinition for noMMU buildBernhard Reutner-Fischer2010-10-271-0/+5
| | | | | | | | | | An architecture that _may_ have a MMU (and thus implements the msync syscall), but for which the kernel and uClibc are built as noMMU, we have a stub for msync. Thanks to Steven J. Magnani for noticing. Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* mips: fix errno setting after syscallAlexander Gordeev2010-10-271-2/+4
| | | | | | | | | | | | | | | If there was an error during syscall then after it's completion a3 register holds a non-zero value and v0 holds an actual error code which should be saved in errno. This can be achieved by calling __syscall_error with the value from v0 as a parameter. So this value should be stored in a0, but the appropriate assembly instructions are missing. Fixed this now by adding "move a0, v0". I think it was once fixed by 58c5f8ba4cdf62342d05a546d15404cbbb3c4e07 but then something went wrong. Again... Signed-off-by: Alexander Gordeev <lasaine@lvk.cs.msu.su> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* *: inline constant __sig{add,del}set and __sigismemberDenys Vlasenko2010-10-225-11/+42
| | | | | | | | | | | | text data bss dec hex filename - 318 4 0 322 142 libc/pwd_grp/lckpwdf.o + 312 4 0 316 13c libc/pwd_grp/lckpwdf.o - 166 0 1 167 a7 libc/stdlib/abort.o + 157 0 1 158 9e libc/stdlib/abort.o - 42 0 0 42 2a libc/sysdeps/linux/common/pause.o + 27 0 0 27 1b libc/sysdeps/linux/common/pause.o Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* remove superfluous libc_hidden_proto(memcpy) and #includeDenys Vlasenko2010-10-222-8/+0
| | | | Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* sleep: tiny code shrinkDenys Vlasenko2010-10-221-4/+4
| | | | | | | | | | | | ...or rather, it WILL BE code shrink when gcc become clever enough to not emit a second, useless XORing of ebx: 31 db xor %ebx,%ebx 85 c0 test %eax,%eax 74 11 je 73 <__GI_sleep+0x73> 31 db xor %ebx,%ebx <=== ?! Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* sleep: employ __USE_EXTERN_INLINES (with necessary fixes)Denys Vlasenko2010-10-223-6/+17
| | | | | | | | | | | __USE_EXTERN_INLINES was unused and had bit-rotted, had to fix it when it didn't work as intended at first. text data bss dec hex filename - 168 0 0 168 a8 libc/unistd/sleep.o + 146 0 0 146 92 libc/unistd/sleep.o Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* sleep: check "SIGCHLD is SIG_IGN'ed" first. Saves two syscalls in common caseDenys Vlasenko2010-10-221-22/+18
| | | | | | | | text data bss dec hex filename - 197 0 0 197 c5 libc/unistd/sleep.o + 168 0 0 168 a8 libc/unistd/sleep.o Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* sleep: remove commented-out code. no code changesDenys Vlasenko2010-10-221-4/+0
| | | | | | It can be easily reconstructed, since it's obvious Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* sleep: code shrinkDenys Vlasenko2010-10-212-33/+28
| | | | | | | | | | | | | | | Use less stack by using same "sigset_t set" object for new and saved signal set, remove redundant clearing of set, and do not save/restore errno around sigprocmask(SIG_SETMASK) - it never changes it. While at it, improve comments and make code style consistent across sleep.c file. text data bss dec hex filename - 242 0 0 242 f2 libc/unistd/sleep.o + 197 0 0 197 c5 libc/unistd/sleep.o Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* vfprintf.c: reduce a chunk of #ifdef forest and remove one goto inside itDenys Vlasenko2010-10-191-21/+20
| | | | | | No code changes according to objdump. Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* _vfprintf.c: de-obfuscate badly twisted fragment. no code changes.Denys Vlasenko2010-10-191-5/+3
| | | | | | objdump confirms that I did not mess it up. Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* vfprintf.c: remove endif comments which clog up the source. no code changesDenys Vlasenko2010-10-191-136/+135
| | | | | | | | | | Example: --ppfs->maxposarg; Verified with objdump that no code is changed Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* vfprintf.c: de-obfuscate if(with nested assignments). no logic changesDenys Vlasenko2010-10-191-25/+38
| | | | | | | God knows this file is hard to read as-is, some readability improvement is in order. Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* getproto: increase line buffer size, simlify and fix alias handlingNatanael Copa2010-10-141-17/+8
| | | | | | | | We increase line buffer size, reduce MAXALIASES and make sure we don't segfault when there are too manuy aliases in /etc/protocols. Signed-off-by: Natanael Copa <natanael.copa@gmail.com> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* getnet: simplify alias handling and reduce MAXALIASESNatanael Copa2010-10-141-17/+8
| | | | | | | | | | Reduce MAXALIASES to something lower. There will probably never be need for more than 1 alias but we allow a few extra. While here we alos fix segfault when there are too many aliases. Signed-off-by: Natanael Copa <natanael.copa@gmail.com> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* getservice: fix handling of long linesNatanael Copa2010-10-141-22/+16
| | | | | | | | | | | | | | | Don't try to be smart by dynamically realloc buffersize as it doesn't work. Instead, be simple and allocate a buffer big enough. This fixes a memory leak when calling getserv{ent,byname,byport} multiple times. To save memory we reduce number of max aliases. We seldomly will need more than 1 anyways. While here, fix segfault that happened if there were too many aliases. Signed-off-by: Natanael Copa <natanael.copa@gmail.com> 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>
* getservice: getservent_r must return ERANGE when buffer is too smallNatanael Copa2010-10-141-3/+2
| | | | | | | | | | | | | | | | | | | This fixes issue introduced by 72e1a1ce186c39f07282398e2af9eb0253e60f15 This should also fix the following testcase to exit with error rather than cause an endless loop. int main(void) { if (getservbyname("non-existing", "udp") == NULL) err(1, "getservbyname"); return 0; } Reported by Pirmin Walthert http://lists.uclibc.org/pipermail/uclibc/2010-August/044277.html 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>
* sparc: pipe.SAustin Foxley2010-10-011-1/+1
| | | | | | return value of pipe on success is supposed to be 0 Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
* nptl: Fix libpthread build when UCLIBC_LINUX_SPECIFIC is disabledCarmelo Amoroso2010-09-202-2/+7
| | | | | | | | | | | | | | | | | NPTL library needs both madvise and statfs symbols, that are guarded by UCLIBC_LINUX_SPECIFIC option. This fix provides these symbols too when NPTL is used, indipendently by UCLIBC_LINUX_SPECIFIC choice. Otherwise libpthread link fails as below: LD libpthread-0.9.32-git.so libpthread/nptl/libpthread_so.a(pthread_create.oS): In function `__free_tcb': pthread_create.c:(.text+0x1184): undefined reference to `madvise' libpthread/nptl/libpthread_so.a(sem_open.oS): In function `__where_is_shmfs': sem_open.c:(.text+0x764): undefined reference to `statfs' collect2: ld returned 1 exit status make: *** [lib/libpthread.so] Error 1 Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
* libc: Handle cancellation in non multiplexed socket callsCarmelo Amoroso2010-09-171-17/+122
| | | | | | | | | | For those archs that provide non multiplexed socket calls it possible to implement the lib C wrappers without calling the multi-purpose __socketcall. For a subset of these functions that are cancellation point, it needs to correctly handle cancellation. Signed-off-by: Francesco Rundo <francesco.rundo@st.com> Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
* nptl_sh: Fix compiler warning due to shadowed variableCarmelo Amoroso2010-09-161-3/+3
| | | | Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
* libc: Add canonicalize_file_name functionCarmelo Amoroso2010-09-163-1/+40
| | | | | | | | Add canonicalize_file_name function and its related tests. Required by elfutils and coreutils (readlink). Signed-off-by: Salvatore Cro <salvatore.cro@st.com> Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
* sh: update the memcpy adding a new loop with aggressive prefetchingSalvatore Cro2010-09-151-21/+107
| | | | | | | | | | | | | | | | After exploring different prefetch distance-degree combinations in this new update of the memcpy function, a new loop has been added for moving many cache lines with an aggressive prefetching schema. Prefetch has been removed when move few cache line aligned blocks. As final result, this memcpy gives us the same performances for small sizes (we already had!) and better numbers for big copies. In case of SH4-300 CPU Series, benchmarks show a gain of ~20% for sizes from 4KiB to 256KiB. In case of the SH4-200, there is a gain of ~40% for sizes bigger than 32KiB. Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com> Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>