summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/aarch64
AgeCommit message (Collapse)Author
2021-04-09open: Add support for O_TMPFILENicolas Cavallari
Since Linux 3.11, O_TMPFILE allows to create unnamed files that can be linked later on. It is internally defined as (O_TMPFILE | O_DIRECTORY) to make it fail on old kernels. Copying definitions from glibc for O_TMPFILE is not enough to support O_TMPFILE; The open() wrapper also need to pass the mode when the flag contains O_TMPFILE, otherwise, it will pass mode 000 which will succeed but yield unexpected results. openat() is curiously not affected since it passes the mode unconditionally.. Signed-off-by: Nicolas Cavallari <nicolas.cavallari@green-communications.fr>
2021-02-19fcntl.h: Make F_DUPFD_CLOEXEC if _USE_XOPEN2K8Paul Cercueil
The F_DUPFD_CLOEXEC flag was added in POSIX 2008.09. Signed-off-by: Paul Cercueil <paul@crapouillou.net>
2020-02-07aarch64/bits: provide sigstack.hVladimir Murzin
It fixes tst-signal6 and friends. Signed-off-by: Vladimir Murzin <vladimir.murzin@arm.com>
2020-02-07aarch64/sys: update ucontext.hVladimir Murzin
It fixes tst-cancel1 and friends. Signed-off-by: Vladimir Murzin <vladimir.murzin@arm.com>
2020-02-03csky: add statx conditionalsWaldemar Brodkorb
Similar to glibc commit https://sourceware.org/git/?p=glibc.git;a=commit;h=6bbfc5c09fc5b5e3d4a0cddbbd4e2e457767dae7 we need to handle Linux kernel change, which removed stat64 family from default syscall set. Signed-off-by: Waldemar Brodkorb <wbx@openadk.org> Signed-off-by: Waldemar Brodkorb <wbrodkorb@conet.de>
2019-10-30Make __syscall_error return long, as expected by syscall() callersCarlos Santos
The return type of syscall() is long so __syscall_error, which is jumped to by syscall handlers to stash an error number into errno, must return long too otherwhise it returs 4294967295L instead of -1L. For example, syscall for x86_64 is defined in libc/sysdeps/linux/x86_64/syscall.S as syscall: movq %rdi, %rax /* Syscall number -> rax. */ movq %rsi, %rdi /* shift arg1 - arg5. */ movq %rdx, %rsi movq %rcx, %rdx movq %r8, %r10 movq %r9, %r8 movq 8(%rsp),%r9 /* arg6 is on the stack. */ syscall /* Do the system call. */ cmpq $-4095, %rax /* Check %rax for error. */ jae __syscall_error /* Branch forward if it failed. */ ret /* Return to caller. */ In libc/sysdeps/linux/x86_64/__syscall_error.c, __syscall_error is defined as int __syscall_error(void) attribute_hidden; int __syscall_error(void) { register int err_no __asm__ ("%rcx"); __asm__ ("mov %rax, %rcx\n\t" "neg %rcx"); __set_errno(err_no); return -1; } So __syscall_error returns -1 as a 32-bit int in a 64-bit register, %rax (0x00000000ffffffff, whose decimal value is decimal 4294967295) and a test like this always returns false: if (syscall(number, ...) == -1) foo(); Fix the error by making __syscall_error return a long, like syscall(). The problem can be circumvented by the caller by coercing the returned value to int before comparing it to -1: if ((int) syscall(number, ...) == -1) foo(); The same problem probably occurs on other 64-bit systems but so far only x86_64 was tested, so this change must be considered experimental. Signed-off-by: Carlos Santos <unixmania@gmail.com>
2019-10-10aarch64: sync with glibc code to see any differences in a better wayWaldemar Brodkorb
2018-02-12uClibc-ng does not implement name_to_handle_atAlexey Neyman
... so don't declare it. Otherwise, eudev finds it declared and tries to link with it - and fails. Signed-off-by: Alexey Neyman <stilor@att.net>
2018-02-03bits/mman.h: consolidate header fileWaldemar Brodkorb
Sync with GNU C library and consolidate duplicate non architecture specific defines. MAP_UNINITIALIZED is only defined to 0x4000000 and used by the Linux kernel when CONFIG_MMAP_ALLOW_UNINITIALIZED is enabled. CONFIG_MMAP_ALLOW_UNINITIALIZED is only available for nommu. See Documentation/nommu-mmap.txt.
2018-01-31aarch64/sys/ucontext.h: include bits/sigcontext.hBernd Kuhls
Fixes a buildroot build error with ffmpeg In file included from /home/bernd/buildroot/output/host/aarch64-buildroot-linux-uclibc/sysroot/usr/include/signal.h:329:0, from fftools/ffmpeg.h:26, from fftools/ffmpeg_opt.c:23: /home/bernd/buildroot/output/host/aarch64-buildroot-linux-uclibc/sysroot/usr/include/sys/ucontext.h:52:16: error: field 'uc_mcontext' has incomplete type mcontext_t uc_mcontext; ^~~~~~~~~~~ using this defconfig: BR2_aarch64=y BR2_PACKAGE_FFMPEG=y sys/ucontext.h for other archs already include bits/sigcontext.h, on aarch64 this is needed as well. Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
2017-07-28aarch64: finetuning, sync with glibcWaldemar Brodkorb
2017-07-28cleanup unused defines and includes from clone.SWaldemar Brodkorb
2017-06-08fcntl.h: fixup namespace for O_DIRECTORY/O_NOFOLLOW/O_CLOEXECWaldemar Brodkorb
Sync with GNU C library. Found while trying to compile linux-rdma to uClibc-ng. Reported-by: Alexey Brodkin <Alexey.Brodkin@synopsys.com>
2017-02-01aarch64: fix syscall_error_handler, fixes tst-mqueue errorsWaldemar Brodkorb
Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
2017-02-01g/c __libc_errnomirabilos
Signed-off-by: mirabilos <m@mirbsd.org> Signed-off-by: Waldemar Brodkorb <wbx@uclibc-ng.org>
2017-02-01add experimental aarch64 supportWaldemar Brodkorb
Ported over from GNU C Library and runtime tested in Qemu.