about summary refs log tree commit diff
path: root/sysdeps/unix
Commit message (Collapse)AuthorAgeFilesLines
* Consolidate vDSO macros and usageAdhemerval Zanella2015-05-2626-552/+288
| | | | | | | | | | | | | | | | This patch consolidate the Linux vDSO define and usage across all ports that uses it. The common vDSO definitions and calling through {INLINE/INTERNAL}_VSYSCALL macros are moved to a common header sysdep-vdso.h and vDSO name declaration and prototype is defined using a common macro. Also PTR_{MANGLE,DEMANGLE} is added to ports that does not use them for vDSO calls (aarch64, powerpc, s390, and tile) and thus it will reflect in code changes. For ports that already implement pointer mangling/demangling in vDSO system (i386, x32, x86_64) this patch is mainly a code refactor. Checked on x32, x86_64, x32, ppc64le, and aarch64.
* Remove socket.S implementationAdhemerval Zanella2015-05-2261-1718/+609
| | | | | | | | | | | | | | | This patch removes the socket.S implementation for all ports and replace it by a C implementation using socketcall. For ports that implement the syscall directly, there is no change. The patch idea is to simplify the socket function implementation that uses the socketcall to be based on C implemetation instead of a pseudo assembly implementation with arch specific parts. The patch then remove the assembly implementatation for the ports which uses socketcall (i386, microblaze, mips, powerpc, sparc, m68k, s390 and sh). I have cross-build GLIBC for afore-mentioned ports and tested on both i386 and ppc32 without regressions.
* Fix pathconf basename namespace (bug 18444).Joseph Myers2015-05-221-1/+1
| | | | | | | | | | | | | | | | | | | | | pathconf (sysdeps/unix/sysv/linux/pathconf.c) uses basename. But pathconf is in POSIX back to 1990 while basename is only reserved with external linkage in those standards including XPG functions. This patch fixes this namespace issue in the usual way, renaming basename to __basename and making it into a weak alias. Tested for x86_64 and x86 (testsuite, and that disassembly of installed shared libraries is unchanged by the patch). [BZ #18444] * string/basename.c (basename): Rename to __basename and define as weak alias of __basename. Use libc_hidden_weak. * include/string.h (__basename): Declare. Use libc_hidden_proto. * sysdeps/unix/sysv/linux/pathconf.c (distinguish_extX): Call __basename instead of basename. * conform/Makefile (test-xfail-POSIX2008/unistd.h/linknamespace): Remove variable. (test-xfail-XOPEN2K8/unistd.h/linknamespace): Likewise.
* NaCl: Set tid field to a unique value.Roland McGrath2015-05-201-0/+30
|
* Move usleep.c using nanosleep to sysdeps/posix.Roland McGrath2015-05-201-33/+0
|
* i386: Remove six-argument specialized implementationsAdhemerval Zanella2015-05-205-197/+2
| | | | | | This patch removes the specialized i386 assembly implementations for fallocate{64}, pselect, and sync_file_range now that i386 have support for 6 argument syscalls.
* Fix non-portable echo usage in sysdeps/unix/make-syscalls.shAdhemerval Zanella2015-05-141-9/+14
| | | | | This patch changes the way make-syscall-sh script uses echo to follow POSIX spec.
* Refactor scandir/scandirat to use common tail.Roland McGrath2015-05-131-8/+7
|
* Break __scandir_cancel_handler out into its own file.Roland McGrath2015-05-131-1/+0
|
* Remove a trailing `\' in make-syscalls.shH.J. Lu2015-05-131-1/+1
| | | | | [BZ #18409] * sysdeps/unix/make-syscalls.sh: Remove a trailing `\'.
* Bug 18125: Call exit after last linked context.Carlos O'Donell2015-05-084-6/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There appears to be a discrepancy among the implementations of setcontext with regards to the function called once the last linked-to context has finished executing via setcontext. The POSIX standard says: ~~~ If the uc_link member of the ucontext_t structure pointed to by the ucp argument is equal to 0, then this context is the main context, and the thread will exit when this context returns. ~~~ It says "exit" not "exit immediately" nor "exit without running functions registered with atexit or on_exit." Therefore the AArch64, ARM, hppa and NIOS II implementations are wrong and no test detects it. It is questionable if this should even be fixed or just documented that the above 4 targets are wrong. The functions are deprecated and nobody should be using them, but at the same time it silly to have cross-target differences that make it hard to port old applications from say x86_64 to AArch64. Therefore I will ix the 4 arches, and checkin a regression test to prevent it from changing again. https://sourceware.org/ml/libc-alpha/2015-03/msg00720.html
* __ASSUME_FALLOCATE is always true on 32-bit architecturesFlorian Weimer2015-05-055-114/+34
| | | | | This means we can clean up the generic code a bit. The 64-bit variant still needs to support !__ASSUME_FALLOCATE for alpha.
* i386: Remove fallocate, fallocate64, posix_fallocate, posix_fallocate64Florian Weimer2015-05-056-232/+3
| | | | | With 6-argument system call support, the generic Linux implementations of these system calls work, and there is no need for i386-specific versions.
* Remove MIPS version of waitid.c.Joseph Myers2015-04-301-7/+0
| | | | | | | | | Since glibc is no longer built with -Winline, a special MIPS version of waitid.c to disable -Winline is no longer needed, and this patch removes it. Tested that glibc does indeed build with the patch applied. * sysdeps/unix/sysv/linux/mips/mips32/waitid.c: Remove file.
* Update sparc localplt.dataDavid S. Miller2015-04-272-8/+6
| | | | | | * sysdeps/unix/sysv/linux/sparc/sparc32/localplt.data: Remove __tls_get_addr. * sysdeps/unix/sysv/linux/sparc/sparc64/localplt.data: Likewise.
* S/390: Get cache information via sysconfStefan Liebler2015-04-241-0/+230
| | | | | | | | | | | This patch adds support to query cache information on s390 via sysconf() function - e.g. with _SC_LEVEL1_ICACHE_SIZE. The attributes size, linesize and assoc can be queried for cache level 1 - 4 via "extract cpu attribute" instruction, which was first available with z10. * NEWS: Mention sysconf() cache information support for s390. * sysdeps/unix/sysv/linux/s390/sysconf.c: New File.
* libc-vdso.h place consolidationAdhemerval Zanella2015-04-2018-14/+14
| | | | | | This patch moves the libc-vdso.h internal header from bits folder to default architecture one and also corrects the remaning includes in the files.
* Convert sparc over to lowlevellock-futex.hDavid S. Miller2015-04-161-146/+1
| | | | | * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Make use of lowlevellock-futex.h
* [BZ #17930] MIPS: Define SHM_NORESERVE.James Cowgill2015-04-071-0/+1
| | | | | [BZ #17930] * sysdeps/unix/sysv/linux/mips/bits/shm.h (SHM_NORESERVE): Define.
* alpha: Unconditionally include dl-sysdep.h in sysdep.hRichard Henderson2015-04-061-5/+1
| | | | Fixes a -Wundef error wrt RTLD_PRIVATE_ERRNO.
* aarch64: Increase MINSIGSTKSZ and SIGSTKSZ (bug 16850)Andreas Schwab2015-04-021-0/+54
|
* Remove unused macros from i386 lowlevellock.h.Joseph Myers2015-03-251-18/+0
| | | | | | | | | | | | | | In the course of the work on six-argument syscalls I noticed that the i386 lowlevellock.h contained some unused macro definitions (already unused before my patch). This patch removes them. Tested for x86 that installed stripped shared libraries are unchanged by this patch. * sysdeps/unix/sysv/linux/i386/lowlevellock.h (LLL_EBX_LOAD): Remove macro. (LLL_EBX_REG): Likewise. (LLL_ENTER_KERNEL): Likewise.
* Support six-argument syscalls from C for 32-bit x86, use generic ↵Joseph Myers2015-03-255-153/+106
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | lowlevellock-futex.h (bug 18138). This patch follows the approach outlined in <https://sourceware.org/ml/libc-alpha/2015-03/msg00656.html> to support six-argument syscalls from INTERNAL_SYSCALL for 32-bit x86, making them call a function __libc_do_syscall that takes the syscall number and three syscall arguments in the registers in which the kernel expects them, along with a pointer to a structure containing the other three arguments. In turn, this allows the generic lowlevellock-futex.h to be used on 32-bit x86, so supporting lll_futex_timed_wait_bitset (and so allowing FUTEX_CLOCK_REALTIME to be used in various cases, so fixing bug 18138 for 32-bit x86 and leaving hppa as the only architecture missing lll_futex_timed_wait_bitset). The change to lowlevellock.h's definition of SYS_futex is because the generic lowlevelloc-futex.h ends up bringing in bits/syscall.h which defines SYS_futex to __NR_futex, so resulting in redefinition errors. The revised definition in lowlevellock.h is in line with what the x86_64 version does. __libc_do_syscall is only needed in libpthread at present (meaning nothing special needs to be done to make it shared-only in most libraries containing it, static in libc only, as on ARM). Tested for 32-bit x86, with the glibc testsuite and with the test in bug 18138. The failures seen FAIL: nptl/tst-cleanupx4 FAIL: rt/tst-cpuclock2 are pre-existing. [BZ #18138] * sysdeps/unix/sysv/linux/i386/sysdep.h (struct libc_do_syscall_args): New structure. (INTERNAL_SYSCALL_MAIN_0): New macro. (INTERNAL_SYSCALL_MAIN_1): Likewise. (INTERNAL_SYSCALL_MAIN_2): Likewise. (INTERNAL_SYSCALL_MAIN_3): Likewise. (INTERNAL_SYSCALL_MAIN_4): Likewise. (INTERNAL_SYSCALL_MAIN_5): Likewise. (INTERNAL_SYSCALL_MAIN_6): Likewise. Call __libc_do_syscall. (INTERNAL_SYSCALL): Define to use INTERNAL_SYSCALL_MAIN_##nr. Replace conditional definitions by conditional definitions of .... (INTERNAL_SYSCALL_MAIN_INLINE): ... this. New macro. * sysdeps/unix/sysv/linux/i386/libc-do-syscall.S: New file. * sysdeps/unix/sysv/linux/i386/Makefile [$(subdir) = nptl] (libpthread-sysdep_routines): Add libc-do-syscall. * sysdeps/unix/sysv/linux/i386/lowlevellock-futex.h: Remove file. * sysdeps/unix/sysv/linux/i386/lowlevellock.h (SYS_futex): Define to __NR_futex not 240.
* powerpc __tls_get_addr call optimizationAlan Modra2015-03-254-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch is glibc support for a PowerPC TLS optimization, inspired by Alexandre Oliva's TLS optimization for other processors, http://www.lsd.ic.unicamp.br/~oliva/writeups/TLS/RFC-TLSDESC-x86.txt In essence, this optimization uses a zero module id in the tls_index GOT entry to indicate that a TLS variable is allocated space in the static TLS area. A special plt call linker stub for __tls_get_addr checks for such a tls_index and if found, returns the offset immediately. The linker communicates the fact that the special __tls_get_addr stub is used by setting a bit in the dynamic tag DT_PPC64_OPT/DT_PPC_OPT. glibc communicates to the linker that this optimization is available by the presence of __tls_get_addr_opt. tst-tlsmod2.so is built with -Wl,--no-tls-get-addr-optimize for tst-tls-dlinfo, which otherwise would fail since it tests that no static tls is allocated. The ld option --no-tls-get-addr-optimize has been available since binutils-2.20 so doesn't need a configure test. * NEWS: Advertise TLS optimization. * elf/elf.h (R_PPC_TLSGD, R_PPC_TLSLD, DT_PPC_OPT, PPC_OPT_TLS): Define. (DT_PPC_NUM): Increment. * elf/dynamic-link.h (HAVE_STATIC_TLS): Define. (CHECK_STATIC_TLS): Use here. * sysdeps/powerpc/powerpc32/dl-machine.h (elf_machine_rela): Optimize TLS descriptors. * sysdeps/powerpc/powerpc64/dl-machine.h (elf_machine_rela): Likewise. * sysdeps/powerpc/dl-tls.c: New file. * sysdeps/powerpc/Versions: Add __tls_get_addr_opt. * sysdeps/powerpc/tst-tlsopt-powerpc.c: New tls test. * sysdeps/unix/sysv/linux/powerpc/Makefile: Add new test. Build tst-tlsmod2.so with --no-tls-get-addr-optimize. * sysdeps/unix/sysv/linux/powerpc/powerpc32/ld.abilist: Update. * sysdeps/unix/sysv/linux/powerpc/powerpc64/ld.abilist: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc64/ld-le.abilist: Likewise.
* pthread_setaffinity (Linux variant): Rewrite to use VLA instead of allocaFlorian Weimer2015-03-231-15/+18
| | | | | | | extend_alloca was used to emulate VLA deallocation. The new version also handles the res == 0 corner case more explicitly, by returning 0 instead of the (potentially undefined, but usually zero) system call error.
* Remove HAVE_ASM_PPC_REL16 referencesAlan Modra2015-03-231-5/+0
| | | | | | | | | | | | | In bc0cdc498 the configure check for HAVE_ASM_PPC_REL16 was removed on the grounds that the minimum binutils supports rel16 relocs. This is true, but not all references to HAVE_ASM_PPC_REL16 in the sources were removed. * config.h.in: Remove HAVE_ASM_PPC_REL16. * sysdeps/powerpc/powerpc32/tls-macros.h: Remove HAVE_ASM_PPC_REL16 and false branch of conditional. * sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext-common.S: Likewise.
* linux-generic: add a READMEChris Metcalf2015-03-191-0/+11
|
* S/390: Fix setcontext/swapcontext which are not restoring sigmask.Stefan Liebler2015-03-124-24/+12
|
* powerpc: Remove HAVE_ASM_GLOBAL_DOT_NAME defineAdhemerval Zanella2015-03-111-5/+1
| | | | | | | | | With AIX port deprecated there is no need to check/define HAVE_ASM_GLOBAL_DOT_NAME anymore since the current minimum binutils supported (2.22) does not emit global symbol with dot. This patch removes all the HAVE_ASM_GLOBAL_DOT_NAME definition and checks for powerpc64 port.
* Correct __ASSUME_PRLIMIT64 for hppa/microblaze/sh (bug 17779).Joseph Myers2015-03-023-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | __ASSUME_PRLIMIT64 is defined in kernel-features.h for kernels 2.6.36 and later, but hppa, microblaze and sh did not add the prlimit64 syscall until 2.6.37. This patch adds corresponding undefines of __ASSUME_PRLIMIT64 to those architectures' kernel-features.h files. (This concludes the kernel-features.h fixes arising out of the review - limited to macros defined in the architecture-independent kernel-features.h file - I did in connection with the move to 2.6.32 minimum kernel version. For that subset of macros - I didn't check any purely architecture-specific macros - I think they are now defined for the correct kernel versions on each architecture after this patch.) [BZ #17779] * sysdeps/unix/sysv/linux/hppa/kernel-features.h [__LINUX_KERNEL_VERSION < 0x020625] (__ASSUME_PRLIMIT64): Undefine. * sysdeps/unix/sysv/linux/microblaze/kernel-features.h [__LINUX_KERNEL_VERSION < 0x020625] (__ASSUME_PRLIMIT64): Likewise. * sysdeps/unix/sysv/linux/sh/kernel-features.h [__LINUX_KERNEL_VERSION < 0x020625] (__ASSUME_PRLIMIT64): Likewise.
* hppa: fix __O_SYNC to match the kernelJohn David Anglin2015-02-271-1/+1
|
* in.h: Coordinate in6_pktinfo and ip6_mtuinfo for kernel and glibc [BZ #15850]Cong Wang2015-02-251-4/+4
| | | | | | | | Similarly to what we did for in6_addr, we need a macro to guard in6_pktinfo and ip6_mtuinfo too. Cc: Carlos O'Donell <carlos@redhat.com> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
* Update timex.h for ADJ_SETOFFSET.Miroslav Lichvar2015-02-241-2/+3
| | | | | ADJ_SETOFFSET is a new adjtimex() mode that can be used to precisely step the clock. It was introduced in kernel 2.6.39.
* linux: open and openat ignore 'mode' with O_TMPFILE in flagsEric Rannaud2015-02-245-11/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Both open and openat load their last argument 'mode' lazily, using va_arg() only if O_CREAT is found in oflag. This is wrong, mode is also necessary if O_TMPFILE is in oflag. By chance on x86_64, the problem wasn't evident when using O_TMPFILE with open, as the 3rd argument of open, even when not loaded with va_arg, is left untouched in RDX, where the syscall expects it. However, openat was not so lucky, and O_TMPFILE couldn't be used: mode is the 4th argument, in RCX, but the syscall expects its 4th argument in a different register than the glibc wrapper, in R10. Introduce a macro __OPEN_NEEDS_MODE (oflag) to test if either O_CREAT or O_TMPFILE is set in oflag. Tested on Linux x86_64. [BZ #17523] * io/fcntl.h (__OPEN_NEEDS_MODE): New macro. * io/bits/fcntl2.h (open): Use it. (openat): Likewise. * io/open.c (__libc_open): Likewise. * io/open64.c (__libc_open64): Likewise. * io/open64_2.c (__open64_2): Likewise. * io/open_2.c (__open_2): Likewise. * io/openat.c (__openat): Likewise. * io/openat64.c (__openat64): Likewise. * io/openat64_2.c (__openat64_2): Likewise. * io/openat_2.c (__openat_2): Likewise. * sysdeps/mach/hurd/open.c (__libc_open): Likewise. * sysdeps/mach/hurd/openat.c (__openat): Likewise. * sysdeps/posix/open64.c (__libc_open64): Likewise. * sysdeps/unix/sysv/linux/dl-openat64.c (openat64): Likewise. * sysdeps/unix/sysv/linux/generic/open.c (__libc_open): Likewise. (__open_nocancel): Likewise. * sysdeps/unix/sysv/linux/generic/open64.c (__libc_open64): Likewise. * sysdeps/unix/sysv/linux/open64.c (__libc_open64): Likewise. * sysdeps/unix/sysv/linux/openat.c (__OPENAT): Likewise.
* hppa: fix build failure with RTLD_PRIVATE_ERRNOMike Frysinger2015-02-241-0/+3
| | | | | Pull in dl-sysdep.h like every other linux sysdep.h header does when it wants to use RTLD_PRIVATE_ERRNO.
* s390: Use generic lowlevellock-futex.hStefan Liebler2015-02-201-325/+10
| | | | | | | | | * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Include <sysdeps/nptl/lowlevellock.h> and remove macros and functions that are now defined there. (SYS_futex): Remove. (lll_compare_and_swap): Remove. * sysdeps/s390/bits/atomic.h (atomic_exchange_acq): Define.
* 2015-02-18 Steve Ellcey <sellcey@imgtec.com>Steve Ellcey2015-02-181-16/+0
| | | | | * sysdeps/unix/sysv/linux/mips/bits/endian.h: Remove. * sysdeps/mips/bits/endian.h: Fix comments.
* Fix posix_spawn getrlimit64 namespace (bug 17991).Joseph Myers2015-02-185-9/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | posix_spawn (a standard POSIX function) brings in a use of getrlimit64 (not a standard POSIX function). This patch fixes this by using __getrlimit64 and making getrlimit64 a weak alias. This is more complicated than some such changes because of files that define getrlimit64 in their own way using symbol versioning after including the main sysdeps/unix/sysv/linux/getrlimit64.c with a getrlimit macro defined. There are various existing patterns for such cases in glibc; the one I've used here is that a getrlimit64 macro disables the weak_alias / libc_hidden_weak calls, leaving it to the including file to define the getrlimit64 name in whatever way is appropriate. Tested for x86_64 and x86 that installed stripped shared libraries are unchanged by this patch. [BZ #17991] * include/sys/resource.h (__getrlimit64): Declare. Use libc_hidden_proto. * resource/getrlimit64.c (getrlimit64): Rename to __getrlimit64 and define as weak alias of __getrlimit64. Use libc_hidden_weak. * sysdeps/posix/spawni.c (__spawni): Call __getrlimit64 instead of getrlimit64. * sysdeps/unix/sysv/linux/getrlimit64.c (getrlimit64): Rename to __getrlimit64. [!getrlimit64] (getrlimit64): Define as weak alias of __getrlimit64. Use libc_hidden_weak. * sysdeps/unix/sysv/linux/i386/getrlimit64.c (getrlimit64): Define using __getrlimit64 not __new_getrlimit64. (__GI_getrlimit64): Likewise. * sysdeps/unix/sysv/linux/mips/getrlimit64.c (getrlimit64): Likewise. (__GI_getrlimit64): Likewise. (__old_getrlimit64): Use __getrlimit64 not __new_getrlimit64. * sysdeps/unix/sysv/linux/powerpc/powerpc64/syscalls.list (getrlimit): Add __getrlimit64 alias. * sysdeps/unix/sysv/linux/wordsize-64/syscalls.list (getrlimit): Likewise. * conform/Makefile (test-xfail-XOPEN2K/spawn.h/linknamespace): Remove variable. (test-xfail-POSIX2008/spawn.h/linknamespace): Likewise. (test-xfail-XOPEN2K8/spawn.h/linknamespace): Likewise.
* S390: Build failure due to nptl/pt-longjmp.c changes.Stefan Liebler2015-02-171-15/+4
|
* ia64: Remove custom lowlevellock.hTorvald Riegel2015-02-171-317/+0
| | | | | | | | | | | ia64 seems to use the same implementation of low-level locks as the generic Linux lowlevellock.h. The futex syscalls are somewhat different, but Roland thought it shouldn't matter. Note that the futex calls are on the slow path always (except for PI mutexes). Removing the custom low-level lock implementation will make further refactoring easier, for example adding proper error checking to futex operations.
* ia64: drop custom getpagesizeMike Frysinger2015-02-171-38/+0
| | | | This is equivalent to the common linux version now, so we can drop it.
* ia64: remove fixed page size macros and others [BZ #17792]Matthew Fortune2015-02-151-6/+0
| | | | | | | | | | | | Remove IA64 PAGE_SIZE related macros as PAGE_SIZE is not defined. Also remove macros that are only used for BFD's trad-core support which is not relavant for IA64 according to the thread starting here: https://sourceware.org/ml/libc-ports/2013-11/msg00028.html This patch is neither built nor tested but is equivalent to a MIPS patch for the same fix.
* Use -Werror=undef for assembly code.Roland McGrath2015-02-121-8/+4
|
* powerpc: Fix TABORT encoding for little endianAdhemerval Zanella2015-02-121-1/+1
| | | | | This patch fix the TABORT encoding for toolchains with no support for HTM builtins.
* Fix value of O_TMPFILE for architectures with non-default O_DIRECTORY (bug ↵Andreas Schwab2015-02-091-1/+1
| | | | 17912)
* NPTL: Build tests using clone directly only for Linux.Roland McGrath2015-02-064-1/+225
|
* x86: Clean up __vdso_clock_gettime variable.Roland McGrath2015-02-066-232/+6
|
* Clean up sysdep-dl-routines variable.Roland McGrath2015-02-066-12/+2
|
* hppa: Sync with pthread.h.Carlos O'Donell2015-02-061-1/+1146
| | | | | | | | This reverts part of the previous commit to refactor pthread.h. The refactoring must be done by having pthread.h include arch bits headers, not the other way around. Then hppa provides the arch bits header. For now we synchronzie again with pthread.h and include the entire contents in the hppa copy.
* glibc 2.21 pre-release update.Carlos O'Donell2015-02-051-1/+1
| | | | | | | | | | | | Update all translations. Update contributions in the manual. Update installation notes with information about newest working tools. Reconfigure using exactly autoconf 2.69. Regenerate INSTALL.