summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/common
AgeCommit message (Collapse)Author
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>
2015-12-05remove __UCLIBC_ASM_GLOBAL_DIRECTIVE__Waldemar Brodkorb
.globl can be used for every architecture so remove the define. Sync with GNU C library.
2015-12-05remove __UCLIBC_HAVE_ASM_GLOBAL_DOT_NAME__Waldemar Brodkorb
It's even no longer required for non-ported ppc64 architecture. Sync with GNU C library. This simplify the macros in include/libc-symbols.h.
2015-11-08fanotify: include needed Linux definitionsWaldemar Brodkorb
To support older Linux kernel f.e. 2.6.32.68 include all required definitions. Copied from musl libc fanotify.h. Reported by Thomas Petazzoni from Buildroot project.
2015-11-08add support for euidaccess/eaccess legacy functionsWaldemar Brodkorb
Implementation taken from musl libc project. Missing functions recognized by buildroot autobuilders with failing open-vm-tools.
2015-10-22alpha: add special umount2 handlingWaldemar Brodkorb
Only on Linux alpha __NR_oldumount is defined and a umount not umount2 syscall, but with two parameter is used. Add special handling for it and an alias for umount2() users. There was a discussion about this special handling, but it seems it was never committed upstream: http://marc.info/?l=linux-alpha&m=137455037930738&w=2 Runtime tested with qemu-alpha and a statically linked busybox binary.
2015-10-14syncfs: add system call supportBartosz Golaszewski
Add support for the syncfs() system call. Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
2015-10-14fanotify: add system call supportBartosz Golaszewski
Add support for fanotify_init() and fanotify_mark() syscalls. The header file is taken from glibc. Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
2015-10-05libc: posix_fallocate must return an error number on failureYuriy Kolerov
posix_fallocate implementation in uClibc relies on fallocate system call - it just returns what fallocate returns. However fallocate returns -1 on failure and assigns an error number to errno variable. In the same time posix_fallocate must return an error number but not -1. What does this patch: if fallocate returns -1 then posix_fallocate returns errno. Otherwise posix_fallocate returns 0 on success. However there is a side effect - posix_fallocate sets errno on failure because fallocate does it. But POSIX does not forbid it thus it's not a problem. Signed-off-by: Yuriy Kolerov <yuriy.kolerov@synopsys.com>
2015-10-05libc: fix sign extension in fallocate()Yuriy Kolerov
For common generic syscall ABI fallocate syscall handler in kernel expects a 64-bit signed arguments for offset and len. However uClibc has 2 wrappers for this syscall: fallocate and fallocate64. On 32-bit machines fallocate (not fallocate64) expects 32-bit values of offset and len. Thus in this case uClibc's fallocate must pass to the syscall those values with sign extension. High word of 64-bit value must be 0 or 0xFFFFFFFF depending on sign of the original 32-bit value (offset or len). It is how sign extansion works - all high bits of the negative value must be 1. So on 32-bit machines uClibc's fallocate does sign extension incorrectly when 32-bit values are passed (offset or len). It just fills the second word of 64-bit value by zeros. E.g. fallocate works incorrectly when offset or length is negative value - in this case kernel thinks that positive values are passed. Solution is to call fallocate64 from fallocate and pass 32-bit values of offset and len to fallocate64. off_t type is automatically converted to off64_t with an appropriate sign extension. Then fallocate64 invokes kernel's system call properly. This error is detected in LTP's test kernel/syscalls/fallocate02: ----------->8---------- fallocate(..., 1, -1024, 1024) failed, expected errno:22: TEST_ERRNO=0 fallocate(..., 1, 1024, -1024) failed, expected errno:22: TEST_ERRNO=0 fallocate(..., 1, 12288, -1024) failed, expected errno:22: TEST_ERRNO=0 fallocate(..., 1, -24576, 1024) failed, expected errno:22: TEST_ERRNO=0 ----------->8---------- fallocate does not emit an error because negative values are passed to the kernel without sign extension and kernel thinks that it got valid positive values. Signed-off-by: Yuriy Kolerov <yuriy.kolerov@synopsys.com>
2015-10-05libc: fix setting return value and errno in fallocate()Yuriy Kolerov
fallocate system call must return 0 on success. On error, -1 is returned and errno is set to indicate the error. However there is an error in fallocate which is fixed by this patch - it does not set errno and returns invalid value on error (it returns error code instead of -1). This error is detected in LTP's test kernel/syscalls/fallocate02: ----------->8---------- fallocate(..., 1, 0, 1024) failed, expected errno:9: TEST_ERRNO=0 fallocate(..., 1, -1024, 1024) failed, expected errno:22: TEST_ERRNO=0 fallocate(..., 1, 1024, -1024) failed, expected errno:22: TEST_ERRNO=0 fallocate(..., 1, 12288, 0) failed, expected errno:22: TEST_ERRNO=0 fallocate(..., 1, 12288, -1024) failed, expected errno:22: TEST_ERRNO=0 fallocate(..., 1, -24576, 1024) failed, expected errno:22: TEST_ERRNO=0 ----------->8---------- Signed-off-by: Yuriy Kolerov <yuriy.kolerov@synopsys.com>
2015-06-10siginfo: add signal info for seccomp related SIGSYSDaniel Golle
uClibc doesn't define signal info for the SIGSYS signal which is issued in case of hitting a syscall prohibited by seccomp. This is sad as it makes debugging seccomp filter policies impossible on some architectures (at least ARM and PowerPC, maybe also others) which do not coincidentally set si_value.sival_int as the syscall number. To fix this, import the definitions and macros needed from glibc. Signed-off-by: Daniel Golle <daniel@makrotopia.org> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2015-04-25Revert "Do not define unimplemented functions"Waldemar Brodkorb
This reverts commit bd3eaf83ef1b4954b6c0e7ba8bbdd29b2cd4a833. They are now implemented.
2015-04-18fix static linking of pthread appsWaldemar Brodkorb
When compiling python you get duplicate symbol problem. Seen in the autobuilders of buildroot project.
2015-04-12remove more of the link_warningsWaldemar Brodkorb
Only the stub warnings left for now.
2015-03-29merge uClibc git masterWaldemar Brodkorb
2015-03-24libc: TIME64_COMPAT32 for sparc, mipsBernhard Reutner-Fischer
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2015-03-22libc: add getrandom(2)Bernhard Reutner-Fischer
Introduce a <sys/random.h> for it. /* FIXME: aren't there a couple of __restrict and const missing ? */ extern int getrandom(void *__buf, size_t count, unsigned int flags) __nonnull ((1)) __wur; Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2015-03-18libm: Add missing C99 float/ld wrappersBernhard Reutner-Fischer
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2015-03-17include: silence __leaf warningBernhard Reutner-Fischer
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2015-03-14Add fix from OpenWrt for MIPS64 N64 ABIWaldemar Brodkorb
https://dev.openwrt.org/browser/trunk/toolchain/uClibc/patches-0.9.33.2/616-mips_fix_stat_time.patch When booting in Qemu you get for example failures from mdev -s otherwise.
2015-03-13unistd.h: put getppid under XOPEN2K8Bernhard Reutner-Fischer
Add __LEAF to all __THROW, introduce non-leaf __THROWNL Adjust affected spots accordingly. Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2015-03-08fix regression for ARM thumb modeWaldemar Brodkorb
Sync with GNU libc, see here why r7 is not usable for thumb mode: https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/unix/sysv/linux/arm/sysdep.h;h=37eac192b1e2e7f53f112b16450b9ce57054e27f;hb=HEAD Remove old OABI support. Fixes build breakage for ARM noMMU builds. Still no runtime testing.
2015-03-04Merge remote-tracking branch 'origin/upstream' into 1.0Waldemar Brodkorb
2015-02-27libc: silence warningBernhard Reutner-Fischer
include/bits/sigset.h:219:62: warning: right-hand operand of comma expression has no effect [-Wunused-value] include/bits/sigset.h:210:63: warning: right-hand operand of comma expression has no effect [-Wunused-value] Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2015-02-26use weak to fix f.e. cdrkit static compile. fixes #3Waldemar Brodkorb
2015-02-20sync with uClibcWaldemar Brodkorb
2015-02-20sync_file_range: fix standard UCLIBC_SYSCALL_ALIGN_64BIT handlingVineet Gupta
Currently UCLIBC_SYSCALL_ALIGN_64BIT is not explicitly handled. Fix that and make sure the special handling is done for powerpc/xtensa which use UCLIBC_SYSCALL_ALIGN_64BIT but don't use hole punched syscall handler in kernel. Signed-off-by: Vineet Gupta <vgupta@synopsys.com> Cc: Baruch Siach <baruch@tkos.co.il> Cc: Max Filippov <jcmvbkbc@gmail.com> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2015-02-20posix_fadvise: handle 2 variants for SYSCALL_ALIGN_64BITVineet Gupta
arm/powerpc/xtensa pass @advice as 2nd arg to syscall (vs. canonical 4th) Current code however does this for UCLIBC_SYSCALL_ALIGN_64BIT which powerpc/xtensa also happen to define. This is not true for ARCv2 ISA and possibly other arch of future with 64-bit even register requirement, which uses the standard syscall handler in kernel. Fix that by providing 2 variants of SYSCALL_ALIGN_64BIT Signed-off-by: Vineet Gupta <vgupta@synopsys.com> Cc: Baruch Siach <baruch@tkos.co.il> Cc: Max Filippov <jcmvbkbc@gmail.com> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2015-02-17libc: add setns()Bernhard Reutner-Fischer
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2015-02-17Add eventfd_read() and eventfd_write()Khem Raj
Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2015-02-14Revert "resolve merge"Waldemar Brodkorb
This reverts commit 6b6ede3d15f04fe825cfa9f697507457e3640344.
2015-02-14resolve mergeWaldemar Brodkorb
2015-01-26merge upstream changesWaldemar Brodkorb
2015-01-26libc: sync_file_range missing commaBernhard Reutner-Fischer
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2015-01-24libc: ppc64 etc: Fix sync_file_rangeBernhard Reutner-Fischer
Fix copy'n paste error for ppc64 and other sync_file_range2 arches Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2015-01-23add argument check in mknodWang Yufen
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> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2014-12-30remove another two warnings.Waldemar Brodkorb
2014-12-28for mips64 with N32 ABI we need to use newfstatatWaldemar Brodkorb
Fixes compile errors with latest util-linux.
2014-12-25merge upstream changesWaldemar Brodkorb
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-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-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-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-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-08-25mathinline.h: Use __extern_inlineBernhard Reutner-Fischer
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>