summaryrefslogtreecommitdiff
path: root/libc
AgeCommit message (Collapse)Author
2014-12-25merge upstream changesWaldemar Brodkorb
2014-12-15mkostemp: fix implementationAnthony G. Basile
mkostemp(char *template, int flags) generates a unique temporary filename from a template. The flags parameter accepts three of the same flags as open(2): O_APPEND, O_CLOEXEC, and O_SYNC. The current implementation of mkostemp(3) does not respect the flags and in fact confuses the flags with the file mode which should always be S_IRUSR | S_IWUSR. This patch corrects this issue. Signed-off-by: Anthony G. Basile <blueness@gentoo.org> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2014-12-15stdio: Fix printing 0.0Bernhard Reutner-Fischer
We were relying on FE_DIVBYZERO being turned off when printing "%f", +-.0 Avoid the whole issue by looking at the sign-bit (in a rough approximation). Note that we do not handle gracefully: printf ("\n%llf\n", -0.0); printf ("\n%llf\n", 0.0); nor %Lf for both when NOT cast to long double. Avoiding an FPE due to broken numbers like these does not make sense to me. Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2014-12-12unistd: allow to turn off getopt_longBernhard Reutner-Fischer
The GNU variant of getopt() previously had no way to turn off getopt_long() support.
2014-12-10mkostemp: fix implementationAnthony G. Basile
mkostemp(char *template, int flags) generates a unique temporary filename from a template. The flags parameter accepts three of the same flags as open(2): O_APPEND, O_CLOEXEC, and O_SYNC. The current implementation of mkostemp(3) does not respect the flags and in fact confuses the flags with the file mode which should always be S_IRUSR | S_IWUSR. This patch corrects this issue. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-12-10add argument check in mknodwangyufen
mknod() in glibc/eglibc will check the argument, like this, ... if (k_dev != dev) { __set_errno (EINVAL); return -1; } ... So add argument check in uclibc's mknod() too. Signed-off-by: Wang Yufen <wangyufen@huawei.com>
2014-12-06arm: add RESET_PID in the clone implWang Yufen
Called getpid() When creating a new process with clone(), getpid() returns the father_process's value. It should be child_process's value. The reason is missing a RESET_PID in the arm clone impl. Signed-off-by: Wang Yufen <wangyufen@huawei.com> Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
2014-12-04Merge remote-tracking branch 'origin/upstream'Waldemar Brodkorb
2014-12-03mips: rename siginfo _timer membersBernhard Reutner-Fischer
Rename _timer[12] to si_tid and si_overrun to fix compilation of strace-4.9+ Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2014-12-01Merge remote-tracking branch 'origin/upstream'Waldemar Brodkorb
2014-11-19locale: Add wcsftime()Bernhard Reutner-Fischer
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2014-11-11Merge remote-tracking branch 'origin/upstream'Waldemar Brodkorb
2014-11-10statfs: fix compile error when UCLIBC_LINUX_SPECIFIC is not setAnthony G. Basile
statfs() is a Linux-specific function. When building without UCLIBC_LINUX_SPECIFIC set, libc_hidden_proto(statfs) in include/sys/statfs.h is unmatched with libc_hidden_def(statfs) in libc/sysdeps/linux/common/statfs.c, leading to a compile error. This patch fixes this, as well as adds statfs() to the list of Linux-specific functions in extra/Configs/Config.in. Signed-off-by: Anthony G. Basile <blueness@gentoo.org> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2014-10-11m68k: remove reg.hWaldemar Brodkorb
If reg.h exist, gdbserver fails to compile. I am not sure if this header file is needed for anything.
2014-10-01remove forced gcc optimizationWaldemar Brodkorb
It was added in 6d6bd8ba78434ecb09395582b5f3e41febd4d4ee, but it is unclear for me, why this is needed or if it is required. I don't think we should depend on some gcc optimization, which might change in the future. Anyway, this breaks c6x toolchain building (ICE), so I remove it. Testsuite run for supported architectures didn't add any new errors.
2014-09-26Add eventfd_read() and eventfd_write()Waldemar Brodkorb
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2014-09-26Do not define unimplemented functionsCristian Morales Vega
e.g. fminf() is not implemented, only fmin(), but both are defined. Signed-off-by: Cristian Morales Vega <cristian@samknows.com>
2014-09-26cris: remove call to HIDDEN_JUMPTARGETWaldemar Brodkorb
errno_location is no longer hidden, so remove the call to the macro, like done for sparc recently.
2014-09-26cris: do not include asm/elf.hWaldemar Brodkorb
elf.h is not exported by the Linux kernel, do not include it here. Done like in other architectures.
2014-09-22xtensa: add support for NPTLWaldemar Brodkorb
Changes from: https://github.com/foss-xtensa/uClibc/commits/xtensa_nptl Author: Chris Zankel <chris@zankel.net> Author: Baruch Siach <baruch@tkos.co.il>
2014-09-20linuxthreads: remove unused s390 codeWaldemar Brodkorb
Cleanup linuxthreads by removing unused s390 code. Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
2014-09-17m68k: libc: add fmovem* mcffpu conditionBernhard Reutner-Fischer
add fmovem{x,.d,.*} ISA conditional Fixes assembler errors for 5206. isa_a, isa_b (or a+, don't remember) do not have emx, use em.d there. Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2014-09-16sparc: update ptrace.h to latest from glibcGustavo Zacarias
Update sys/ptrace.h to latest glibc release for a lot of missing definitions. Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2014-09-16powerpc: update ptrace.h to latest from glibcGustavo Zacarias
Update sys/ptrace.h to latest glibc release for a lot of missing definitions. Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2014-09-16libc: silence missing prototype warningBernhard Reutner-Fischer
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2014-09-16buildsys: fix IS_IN_lib*Bernhard Reutner-Fischer
define NOT_IN_libc / IS_IN_libxxx appropriately to fix pthread_once Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2014-09-09libc: add fallocate() and fallocate64()Anthony G. Basile
We add the Linux-specific function fallocate() which allows the user to directly manipulate allocate space for a file. fallocate() can operate in different modes, but the default mode is equivalent to posix_fallocate() which is specified in POSIX.1. Recent releases of e2fsprogs 1.42.11 and above expect fallocate64() to be available. Signed-off-by: Anthony G. Basile <blueness@gentoo.org> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2014-09-05libc: split multi-source epoll.cBernhard Reutner-Fischer
We cannot override individual functions on a per-arch basis otherwise Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2014-09-04sparc: remove sparc64/sparcv9 codeWaldemar Brodkorb
The sparc64/sparcv9 code is incomplete. Furthermore there is no real embedded hardware for sparc64 available, so better remove it until someone comes up with a complete port. Signed-off-by: Waldemar Brodkorb <wbx@openadk.org> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2014-08-28m68k: fix typoWaldemar Brodkorb
otherwise you get compile warnings, when building for m68k. Signed-off-by: Waldemar Brodkorb <wbx@openadk.org> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2014-08-28Revert "sparc: disable cancellable system, as it fails in strange ways right ↵Waldemar Brodkorb
now" This reverts commit 1db4f8f8389f6a935ecd83aff7fcce5d1cf2c0f3. It is unclear in which way this is breaking sparc systems. With this change added you get following linking error: libpthread/nptl/libpthread_so.a(pt-system.oS): In function `__libc_system': libc/stdlib/system.c:64: undefined reference to `__wait4_nocancel' Signed-off-by: Waldemar Brodkorb <wbx@openadk.org> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2014-08-28Revert "sparc: use HIDDEN_JUMPTARGET for errno"Waldemar Brodkorb
This reverts commit f51fb26dbcceee9e48d10facc830bd4a549f6cc2. This fixes linking error for sparc build. While building a sparc system you get following linking error: libc/sysdeps/linux/sparc/pipe.S:54: undefined reference to `__GI___errno_location' Removing the HIDDEN_JUMPTARGET fixes the issue, while using gcc 4.8.3/binutils 2.24. The definition of __errno_location was changed recently here: http://git.uclibc.org/uClibc/commit/?id=8f550715c2b211036fc273add3cb5219397ed312 Signed-off-by: Waldemar Brodkorb <wbx@openadk.org> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2014-08-25microblaze: Remove duplicate F_{S,G}ETPIPE_SZBernhard Reutner-Fischer
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2014-08-25fcntl.h: Define F_SETPIPE_SZ and F_GETPIPE_SZKhem Raj
Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2014-08-25mathinline.h: Use __extern_inlineBernhard Reutner-Fischer
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2014-08-25Add clock_adjtime syscallKhem Raj
Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2014-08-20fix for pipe() on sparcWaldemar Brodkorb
When using something like this: $ echo foo|grep foo|wc -l with mksh shell, you get an runtime error. Glibc and klibc does not do these extra check. After removing this check using double pipes work fine. Tested with Qemu 2.1.0. Signed-off-by: Waldemar Brodkorb <wbx@openadk.org> Signed-off-by: Thorsten Glaser <tg@mirbsd.org> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2014-08-18libc: add issetugid()Anthony G. Basile
issetugid() returns 1 if the process environment or memory address space is considered tainted, and returns 0 otherwise. This happens, for example, when a process's privileges are elevated by the setuid or setgid flags on an executable belonging to root. This function first appeard in OpenBSD 2.0 and is needed for the LibreSSL. This patch follows the same logic as the equivalent musl commit. For more information see the commit message at http://git.musl-libc.org/cgit/musl/commit/?id=ddddec106fd17c3aca3287005d21e92f742aa9d4 Signed-off-by: Anthony G. Basile <blueness@gentoo.org> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2014-08-18lseek: Correct order of offset argumentsAnton Kolesov
There was a runtime error in systems without large file support. Call fseek(fd, 4096, SEEK_SET) has been failing with EINVAL, though it was succeeding for offset = 4092. This has been happening because llseek system call accepts 64-bit value as an offset argument and lseek function has been ordering 32-bits words that form this offset value, according to the endianness. However this ordering to match endianness is not required, because llseek doesn't accept one 64-bit offset argument, it accepts two 32-bit offset argument, then stitches them into one following its endianness. As a result on little endian system, order of words has been swapped two time: in libc and in kernel. Thus call to fseek with offset 4096 (0x1000) was doing a system call to llseek with offset 0x1000_0000_0000. I'm not entirely sure why then offset = 4092 hasn't been failing then. This patch removes malicious swap of words when calling llseek. Signed-off-by: Anton Kolesov <Anton.Kolesov@synopsys.com> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2014-08-18libc: posix_fadvise: Fix build breakage for !LFSVineet Gupta
commit 00571b43df2e "libc: posix_fadvise: restore implementation for xtensa" enabled posix_fadvise() for all arches (it was just not generated before). However this also unearthed an issue introduced by ee84b8b400 "linux: posix_fadvise: use new SYSCALL_ALIGN_64BIT" which is to referencing LFS'ish code (off64_t) w/o proper checks which causes build to break for !LFS. Fix this by calling posix_fadvise64() only for LFS case and open-code it's equivalent for !LFS. Signed-off-by: Vineet Gupta <vgupta@synopsys.com> Cc: Mike Frysinger <vapier@gentoo.org> Cc: Baruch Siach <baruch@tkos.co.il> Cc: Khem Raj <raj.khem@gmail.com> Cc: markos Chandras <markos.chandras@gmail.com> Cc: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2014-08-18unbreak networking code for sparcWaldemar Brodkorb
This commit 1e2e4ac6193ffe0900bd392fa3c596883771eb34 breaks networking on sparc systems. In Linux the socket functions are declared, but not implemented and must be routed through socketcall(). Tested via Qemu 2.0.0. Signed-off-by: Waldemar Brodkorb <wbx@openadk.org> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2014-08-18ARC/NPTL: clone to set TP if CLONE_SETTLSVineet Gupta
Typically kernel would set the TP register of newly created thread in clone syscall with CLONE_SETTLS. However this implies that: * kernel knows of the exact TP register (which is already different for ARCompact and ARCv2) and is a detail which becomes part of the ABI * kernel also needs to handle the unlikely but possible case of !TLS userspace (e.g. Android libc) case where TP reg is not reserved and thus need not be mucked with (using ELF personality based detection) It is better to confine this detail to userspace runtime and set TP reg right after clone syscall returns. Signed-off-by: Vineet Gupta <vgupta@synopsys.com> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2014-08-18NPTL: ARC supportVineet Gupta
Signed-off-by: Vineet Gupta <vgupta@synopsys.com> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2014-08-01bits/time.h: sync with latest glibcMike Frysinger
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2014-07-22ARC: Implement native GDB requirements in procfs.hAnton Kolesov
Native GDB requires elf_fpregset_t to be defined, even if floating point registers are absent. In this case we use empty structure. Additionally we redefined prfpregset_t to use this new type. And there has been an error: it was defined that user_regs_struct has 20 registers, while it has 40. Signed-off-by: Anton Kolesov <Anton.Kolesov@synopsys.com> Signed-off-by: Vineet Gupta <vgupta@synopsys.com> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2014-07-22ARC: clone: Ensure that @fn returns back to cloneVineet Gupta
This showed up due to longstanding test/unistd/clone failure where post clone, the callback was not exiting and rather falling thru in into main program. Signed-off-by: Vineet Gupta <vgupta@synopsys.com> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2014-07-22ARC: make sigaction inline with other archesVineet Gupta
Signed-off-by: Vineet Gupta <vgupta@synopsys.com> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2014-07-22ARC: syscalls.h: code-reuse/fix-arg-annotationsVineet Gupta
- Use syscalls-common.h vers of INTERNAL_SYSCALL / INLINE_SYSCALL_NOERR - INLINE_SYSCALL takes syscall name (e.g. write) - {INLINE,INTERNAL}_SYSCALL_NCS macros take syscall num (__NR_write) Signed-off-by: Vineet Gupta <vgupta@synopsys.com> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2014-07-22syscalls-common.h: Rename some macro args for correct documentationVineet Gupta
Signed-off-by: Vineet Gupta <vgupta@synopsys.com> Cc: Mike Frysinger <vapier@gentoo.org> Cc: Denys Vlasenko <vda.linux@googlemail.com> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2014-06-24open64: ensure that openat check worksVineet Gupta
For ARC builds atleast, __NR_xxx was not trickling into in open64.c causing open64->openat a needless detour via open Signed-off-by: Vineet Gupta <vgupta@synopsys.com> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>