summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/common
AgeCommit message (Collapse)Author
2017-11-25statfs.h: add f_flagsWaldemar Brodkorb
Add missing member in struct statfs. It is used by xfsprogs (f.e. 4.13.1). Reported-by: Joshua Kinard <kumba@gentoo.org>
2017-11-22librt: fix broken posix_spawnWaldemar Brodkorb
Fix iteration over signals, synced with GNU C library code and pending patches. Issues found when running dhcpcd with hook scripts. (exit status 127) Reported-By: kapeka <kapeka@bering-uclibc.de>
2017-11-19csky: port to uclibc-ngGuo Ren
Follow the steps to build c-sky uclibc linux system: 1. git clone https://github.com/c-sky/buildroot.git 2. cd buildroot 3. make qemu_csky_ck810_uclibc_defconfig 4. make Follow the buildroot/board/qemu/csky/readme.txt to run. This buildroot toolchain is pre-build, But you can rebuild the c-sky uclibc-ng alone and install it to the buildroot sysroot manually. We'll try our best to improve the uclibc-ng continuously. Signed-off-by: Guo Ren <ren_guo@c-sky.com>
2017-11-19remove unused FORTIFY code fragmentsWaldemar Brodkorb
2017-11-03math: add exception handling functionalitySergey Cherkashin
According to standards SVID and SYSV. Modified lgamma calling in case when 'signgam' variable should not be used. Signed-off-by: Waldemar Brodkorb <wbx@uclibc-ng.org>
2017-10-01preadv/pwritev: bugfix preadv/pwritev syscall should be 5 argsGuo Ren
The current uclibc-ng use 4 arguments, and this will cause ltp-testsuite's preadv/pwritev case failed. The syscall of preadv/pwritev in current linux-kernel is 5 arguments: linux/fs/read_write.c: SYSCALL_DEFINE5(preadv, unsigned long, fd, const struct iovec __user *, vec, unsigned long, vlen, unsigned long, pos_l, unsigned long, pos_h) SYSCALL_DEFINE5(pwritev, unsigned long, fd, const struct iovec __user *, vec, unsigned long, vlen, unsigned long, pos_l, unsigned long, pos_h) So just update to 5-args-syscall, and off_t could be 32bit or 64bit. Signed-off-by: Guo Ren <ren_guo@c-sky.com>
2017-08-10sys/ptrace.h: remove obsolete Linux PTRACE_SEIZE_DEVEL constantWaldemar Brodkorb
Remove enum __ptrace_flags along with the only constant it contains, PTRACE_SEIZE_DEVEL, from Linux's sys/ptrace.h files. Following GNU C library commit: 60e2846e2633a990bdf474004a373bde54c0bc5f
2017-07-28fix tolower and localesEugene Yudin
The function towlower doesn't work with locales different from C. Issue was introduced in commit: 8cde3a9bf2856dcb9a759dec7ecb04a68e712254 Call to setlocale is needed for correct generation of the table uplow_diff. Otherwise you receive compile time error "range assumption error" after uncommenting the call. Similar problem described here: http://lists.uclibc.org/pipermail/uclibc/2015-March/048852.html This commit fix the problem by using int32_t values.
2017-06-23sparc64: add basic supportWaldemar Brodkorb
No NPTL, no LDSO support. Bootup with Busybox Ash in Qemu working. Testuite shows only two failures, but mksh continue/break support doesn't work.
2017-06-21remove editor hints for viWaldemar Brodkorb
2017-04-22remove unused HP_TIMING_AVAIL and headerWaldemar Brodkorb
cleanup unused and unsupported code.
2017-04-16libm: allow long double wrappers for all architecturesWaldemar Brodkorb
If you enable these wrappers, be sure you don't need long double precision on your embedded device, as these only enables long double warpper functions to the existing double math functions. Required to build some software as lvm2. Signed-off-by: Waldemar Brodkorb <wbx@uclibc-ng.org>
2017-02-23guard new syscalls preadv/pwritevWaldemar Brodkorb
2017-02-18remove dead code in dlfcn.hWaldemar Brodkorb
2017-02-03fstat: make new code aarch64 specificWaldemar Brodkorb
The new code get's used by MIPS64 N64 and fails. Make the new code aarch64 specific.
2017-02-01add experimental aarch64 supportWaldemar Brodkorb
Ported over from GNU C Library and runtime tested in Qemu.
2017-01-28remove PID cachingWaldemar Brodkorb
Follow GNU C Library from c579f48edba88380635ab98cb612030e3ed8691e and remove the PID caching. These simplifies the architecture specific assembly code. The run of the test suite found no regressions, it even solves some of the test failures for x86/x86_64/sparc. Reviewed-by: Max Filippov <jcmvbkbc@gmail.com> Reviewed-by: Vineet Gupta <Vineet.Gupta1@synopsys.com> Acked-by: Matthew Fortune <Matthew.Fortune@imgtec.com> Acked-by: Alexey Brodkin <Alexey.Brodkin@synopsys.com>
2017-01-22nds32: add NPTL/TLS, *context function, libm changes and code cleanupVincent Ren-Wei Chen
This commit includes following features. 1. Support NPTL/TLS 2. Add libm function which is used to handle FP rounding and excpetions (ex: fclrexcpt,fedisblxcpti,feenablxcpt... ) 3. Add *context function for operating user context (ex: setcontext,getcontext,makecontext... ) 4. Change the return flow from signal handler 5. Cleanup of old code The testsuite only has 2 errors, tst-cpuclock1 and tst-cputimer1, which are related to timing accuracy. (math and locale tests are disabled) Signed-off-by: Vincent Ren-Wei Chen <vincentc@andestech.com>
2017-01-14add wrappers for preadv/pwritevWaldemar Brodkorb
2016-12-28add init_module/delete_module syscall wrappersWaldemar Brodkorb
Add the wrappers unconditionally, because kmod package still uses them.
2016-12-23remove UCLIBC_LINUX_MODULE_26Waldemar Brodkorb
The syscall wrappers are not required and other C libraries do not provide them. Busybox modutils.c must be patched so that syscall() is used for uClibc-ng. Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
2016-12-10libc/sysdeps/linux/common/madvise.c: disable on noMMU architecturesThomas Petazzoni
Similar to what was done in commit 9945c6d21797553e78cbef8034f6dd16b3824df5 for posix_madvise(). Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2016-11-28posix_madvise not available for noMMUWaldemar Brodkorb
2016-11-27remove UCLIBC_HAS_LFSWaldemar Brodkorb
2016-11-27do not define madvise related macros for noMMU targetsWaldemar Brodkorb
2016-11-27fixup gcc warningsWaldemar Brodkorb
Remove following warning from common code: warning: ISO C90 forbids mixed declarations and code
2016-11-10nptl: add pthread_getname_np/pthread_setname_np from GNU libcWaldemar Brodkorb
These functions are used by firefox for example. Tested with running firefox on x86 system.
2016-09-30remove linux kernel 2.4 modules supportWaldemar Brodkorb
2016-09-26locale: cleanup supportWaldemar Brodkorb
Enable locale application to be build when utils are build. Remove useless compile and link warnings. Default to minimal locale builds. Signed-off-by: Waldemar Brodkorb <wbx@uclibc-ng.org>
2016-09-26use a single libc and deduplicate threading codeWaldemar Brodkorb
Similar to musl libc a single libc has many benefits and solves some open issues with uClibc-ng. - no pthread_mutex_* weak symbols exported anymore - applications no longer failing to link when either -lrt or -lpthread are missing for dynamic and static linking mode - smaller C library - slightly better runtime performance
2016-09-26always assume tgkill is presentWaldemar Brodkorb
We do not support 2.4 Linux kernels anyway, and almost all newer 2.6 kernels should have tgkill syscall. Cleanup the raise situation, pt-raise.c is unused, sync raise.c with latest GNU libc. Signed-off-by: Waldemar Brodkorb <wbx@uclibc-ng.org>
2016-06-25bits/sigset.h: Fix _EXTERN_INLINE redefinitionLeonid Lisovskiy
Commit 251a3c19cb "sleep: employ __USE_EXTERN_INLINES (with necessary fixes)" introduces following problems: 1. __USE_EXTERN_INLINES forcibly enabled build fails ... LD libuClibc-1.0.15.so libc/libc_so.a(cmsg_nxthdr.os): In function `__GI___cmsg_nxthdr': cmsg_nxthdr.c:(.text.__GI___cmsg_nxthdr+0x0): multiple definition of `__GI___cmsg_nxthdr' libc/libc_so.a(close.os):close.c:(.text.__GI___cmsg_nxthdr+0x0): first defined here libc/libc_so.a(creat.os): In function `__GI___cmsg_nxthdr': creat.c:(.text.__GI___cmsg_nxthdr+0x0): multiple definition of `__GI___cmsg_nxthdr' libc/libc_so.a(close.os):close.c:(.text.__GI___cmsg_nxthdr+0x0): first defined here ... 2. libuargp wrongly contains __cmsg_nxthdr/__sigismember/__sigdelset/__sigaddset global symbols on platforms which includes signal.h from sys/procfs.h As result, static linking will fail: TEST_LINK argp/ bug-argp1 /home/wbx/ppc-static/target_qemu-ppc-macppc_uclibc-ng_hard/usr/lib/libc.a(sigsetops.os): In function `__GI___sigismember': sigsetops.c:(.text+0x0): multiple definition of `__sigismember' /home/wbx/ppc-static/target_qemu-ppc-macppc_uclibc-ng_hard/usr/lib/libuargp.a(argp-xinl.os):argp-xinl.c:(.text+0x0): first defined here /home/wbx/ppc-static/target_qemu-ppc-macppc_uclibc-ng_hard/usr/lib/libc.a(sigsetops.os): In function `__GI___sigaddset': sigsetops.c:(.text+0x28): multiple definition of `__sigaddset' /home/wbx/ppc-static/target_qemu-ppc-macppc_uclibc-ng_hard/usr/lib/libuargp.a(argp-xinl.os):argp-xinl.c:(.text+0x28): first defined here /home/wbx/ppc-static/target_qemu-ppc-macppc_uclibc-ng_hard/usr/lib/libc.a(sigsetops.os): In function `__GI___sigdelset': sigsetops.c:(.text+0x4c): multiple definition of `__sigdelset' /home/wbx/ppc-static/target_qemu-ppc-macppc_uclibc-ng_hard/usr/lib/libuargp.a(argp-xinl.os):argp-xinl.c:(.text+0x4c): first defined here We have to partially revert 251a3c19cb to fix problems above. It is safe to do this after commit 162cfaea20 *: inline constant __sig{add,del}set and __sigismember since we are able to use new inlines from within libc and leave the rest of world(__USE_EXTERN_INLINES) equal to glibc now. Signed-off-by: Leonid Lisovskiy <lly.dev@gmail.com>
2016-06-07ssp: remove SSP legacy codeWaldemar Brodkorb
Nobody should use gcc 3.3 nowadays.
2016-05-18remove linuxthreads.new, rename linuxthreads.oldWaldemar Brodkorb
Linuxthreads.new isn't really useful with the existence of NPTL/TLS for well supported architectures. There is no reason to use LT.new for ARM/MIPS or other architectures supporting NPTL/TLS. It is not available for noMMU architectures like Blackfin or FR-V. To simplify the live of the few uClibc-ng developers, LT.new is removed and LT.old is renamed to LT. LINUXTHREADS_OLD -> UCLIBC_HAS_LINUXTHREADS
2016-04-15replace FSF addresses with URLsNikola Forró
License notices in most of the source files refer to an outdated FSF address. Replace it with URL, like in the rest of the source files.Signed-off-by: Nikola Forró <nforro@redhat.com>
2016-04-11simplify getpagesize, do not depend on kernel macrosWaldemar Brodkorb
Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
2016-03-31bits/byteswap-common.h: import recent headers from glibcAnthony G. Basile
On systems where uClibc doesn't provide an arch specific byteswap.h, we fall back on bits/byteswap-common.h. However, there is a bug in this header in the __bswap_constant_64(x) macro. If, for example, a double is passed, we get 'invalid operands to binary &' in which we mismatch a 'double' and 'long long unsigned int'. The newer glibc headers fix this and so we import them. Also, since the inclusion of byteswap.h is not appropriate for assembly code, we guard a portion of endian.h which uses byteswap.h from inclusion in any assembly. This is needed, for example, for f2fs-tools 1.6.0 on 32-bit big endian PowerPC. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2016-01-31Provide __adjtimex() alias, like glibc.Leonid Lisovskiy
Althought recent versions of sofware don't require it, old ntpd wants - see http://bugs.ntp.org/show_bug.cgi?id=769 Signed-off-by: Leonid Lisovskiy <lly.dev@gmail.com> Signed-off-by: Waldemar Brodkorb <wbx@uclibc-ng.org>
2016-01-30add exp10() from glibcWaldemar Brodkorb
Some software make use of exp10, so add it. Basic testing with LTP. Signed-off-by: Waldemar Brodkorb <wbx@uclibc-ng.org>
2016-01-12Suppress warning "_GNU_SOURCE" redefinedWaldemar Brodkorb
libc/sysdeps/linux/common/euidaccess.c:1:1: warning: "_GNU_SOURCE" redefined In file included from <command-line>:0: ./include/libc-symbols.h:52:1: warning: this is the location of the previous definition Signed-Off-By: Leonid Lisovskiy <lly.dev@gmail.com>
2016-01-10Provide XTI __t_scalar_t types, like glibcWaldemar Brodkorb
Reported-by: Leonid Lisovskiy <lly.dev@gmail.com>
2016-01-06Remove alias.Yoshinori Sato
open_cancel and open2_cancel have diffrent argument on open. So can't alias this functions. Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
2016-01-06openat argument fix.Yoshinori Sato
If argument passing to register case (ex. -mregparam=3). This case set all parameters set to register from caller. But callee refer to stack. So can't get parameter. Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
2016-01-06__ARCH_HAS_DEPRECATED_SYSCALLS__ case fix. getdents is deprecated.Yoshinori Sato
Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
2016-01-06extra/Configs/Config.in: add syncfs() to Linux-specific functionsAnthony G. Basile
syncfs() was recently added (commit dfa593d4d). But man sync(2) specifies that syncfs() is Linux-specific. This was overlooked in the original commit so we add it to the set of Linux-specific functions supported by uClibc. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2016-01-01Add argp implementationSalvatore Cro
Argp is an advanced support for parsing unix-style argument vectors. In addition to the common getopt interface, it provides automatic response to `--help' and `--version' options and use of custom parser in conjunction with argp native option parser, among others. Argp support is required by elfutils package and prelink. In uClibc argp functionalities has been moved from C library to libuargp.so Further the libc.so linker script contains an AS_NEEDED entry so that it doesn't need to link libuargp.so explicitely. Disable argp test if feature disabled. Signed-off-by: Salvatore Cro <salvatore.cro@st.com> Signed-off-by: Filippo Arcidiacono <filippo.arcidiacono@st.com> Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com> Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Waldemar Brodkorb <wbx@uclibc-ng.org>
2016-01-01Fix "pselect: Use linux pselect6 syscall when available"Leonid Lisovskiy
Commit e3c3bf2b58 introduce use of pselect6, but has following disadvantages: * Use of userspace types in args67 structure - it breaks, for example, configs when 32-bit uClibc-ng compiled against 64-bit kernel. Syscall will always return EINVAL. We must use __kernel_* types and __SYSCALL_SIGSET_T_SIZE. * It have excess checks for NSEC_PER_SEC. Original code from select() implementation has struct timeval => struct timespec conversion, kernel select() syscall implementation do the same. But none of libc versions (glibc, eglibc, musl) I know, perform similar checks for pselect() - there is no structure fields conversions, just struct timespec through all the calls. To have such checks in uClibc-ng we need one example, at least. * It is possible to avoid extra userspace reads from kernel code if sigmask == NULL. I suggest to do it, for a few bytes cost. * Commit didn't add test case to testsuite. Signed-off-by: Leonid Lisovskiy <lly.dev@gmail.com>
2015-12-22pselect: Use linux pselect syscall when availableNicolas S. Dade
Linux has a pselect syscall since 2.6.something. Using it rather than emulating it with sigprocmask+select+sigprocmask is smaller code, and works properly. (The emulation has race conditions when unblocked signals arrive before or after the select) The tv.nsec >= 1E9 handling comes from uclibc's linux select() implementation, which itself uses pselect() internally if the pselect syscall exists. I though it would be good to do the same here. Note that although the libc pselect() API has 6 arguments, the linux kernel syscall as 7 arguments. There is an extra, somewhat vestigial, sizeof the signal mask argument. Signed-off-by: Nicolas S. Dade <nic.dade@gmail.com>
2015-12-22Do define some IPv6 related symbols even with IPv6 disabledWaldemar Brodkorb
Fixes compilation of some faulty applictions. Patch from Freetz.org Reported-by: Leonid Lisovskiy <lly.dev@gmail.com>
2015-12-17libc/stdio: Rework custom streams interface similar to glibc.Waldemar Brodkorb
Save 20 bytes per FILE structure, avoid indirect call for read/write/seek/close operations for normal streams. Additionally, custom streams has fileno = -2 now, like in glibc. bloat-o-meter report (UCLIBC_HAS_GLIBC_CUSTOM_STREAMS=y): function old new delta fopencookie 69 131 +62 ftello64 233 260 +27 fseeko64 298 319 +21 fclose 423 442 +19 .rodata 16696 16708 +12 fileno_unlocked 53 45 -8 __ns_name_pack 859 851 -8 vswscanf 184 144 -40 vdprintf 231 187 -44 vsscanf 210 151 -59 vswprintf 269 201 -68 vsnprintf 249 181 -68 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 5/7 up/down: 141/-295) Total: -154 bytes Signed-off-by: Leonid Lisovskiy <lly.dev@gmail.com> Signed-off-by: Waldemar Brodkorb <wbx@uclibc-ng.org>