about summary refs log tree commit diff
path: root/sysdeps/unix/sysv
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* 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.
* 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.
* hppa: Remove warnings and fix conformance errors.Carlos O'Donell2015-02-056-1205/+69
| | | | | | | | | | | | | | | | | (1) Fix warnings. This is a bulk update to fix all the warnings that were causing build failures with -Werror on hppa. The most egregious problems are in dl-fptr.c which needs to be entirely rewritten, thus I've used -Wno-error for that. (2) Fix conformance errors. The sysdep.c file had __syscall_error and syscall in one file which caused conformance issues by including syscall when __syscall_error was linked to. The fix is obviously to split the file and use syscall.c to implement syscall.
* ia64: avoid set-but-not-used warningAndreas Schwab2015-01-251-0/+3
|
* m68k/coldfire: avoid warning about volatile register variablesAndreas Schwab2015-01-251-10/+9
|
* BZ #16418: Fix powerpc get_clockfreq racinessAdhemerval Zanella2015-01-211-69/+59
| | | | | | | | This patch fix powerpc __get_clockfreq racy and cancel-safe issues by dropping internal static cache and by using nocancel file operations. The vDSO failure check is also removed, since kernel code does not return an error (it cleans cr0.so bit on function return) and the static code (to read value /proc) now uses non-cancellable calls.
* Fix semaphore destruction (bug 12674).Carlos O'Donell2015-01-2118-1793/+0
| | | | | | | | | | | | | This commit fixes semaphore destruction by either using 64b atomic operations (where available), or by using two separate fields when only 32b atomic operations are available. In the latter case, we keep a conservative estimate of whether there are any waiting threads in one bit of the field that counts the number of available tokens, thus allowing sem_post to atomically both add a token and determine whether it needs to call futex_wake. See: https://sourceware.org/ml/libc-alpha/2014-12/msg00155.html
* Commit nios2 port to master.Chung-Lin Tang2015-01-1744-0/+4790
|
* S390: Get rid of linknamespace failures for utmp functions.Stefan Liebler2015-01-167-14/+42
|
* Add x86 32 bit vDSO time function supportAdhemerval Zanella2015-01-1216-118/+313
| | | | | | | | | | Linux 3.15 adds support for clock_gettime, gettimeofday, and time vDSO (commit id 37c975545ec63320789962bf307f000f08fabd48). This patch adds GLIBC supports to use such symbol when they are avaiable. Along with x86 vDSO support, this patch cleanup x86_64 code by moving all common code to x86 common folder. Only init-first.c is different between implementations.
* powerpc: Fix Copyright dates and CL entryAdhemerval Zanella2015-01-1213-13/+13
| | | | | This patch fixes the copyright dates from files created by commit 8d2c0a5, 4b45943, and 56cf276.
* powerpc: abort transaction in syscallsAdhemerval Zanella2015-01-122-0/+2
| | | | | | | | | | | Linux kernel powerpc documentation states issuing a syscall inside a transaction is not recommended and may lead to undefined behavior. It also states syscalls does not abort transactoin neither they run in transactional state. To avoid side-effects being visible outside transactions, GLIBC with lock elision enabled will issue a transaction abort instruction just before all syscalls if hardware supports hardware transactions.
* powerpc: Add adaptive elision to rwlocksAdhemerval Zanella2015-01-122-3/+8
| | | | | | This patch adds support for lock elision using ISA 2.07 hardware transactional memory for rwlocks. The logic is similar to the one presented in pthread_mutex lock elision.
* powerpc: Add the lock elision using HTMAdhemerval Zanella2015-01-1215-5/+672
| | | | | | | | | | | | This patch adds support for lock elision using ISA 2.07 hardware transactional memory instructions for pthread_mutex primitives. Similar to s390 version, the for elision logic defined in 'force-elision.h' is only enabled if ENABLE_LOCK_ELISION is defined. Also, the lock elision code should be able to be built even with a compiler that does not provide HTM support with builtins. However I have noted the performance is sub-optimal due scheduling pressures.
* MicroBlaze: Fix BZ17791 - Remove fixed page size macros and othersMatthew Fortune2015-01-091-8/+0
| | | | | | | | | | | | | | | | | | | | | | Microblaze apparently has a variable page size (see thread below) and should not hard-code any page-size related macros. Also remove macros that are only used for BFD's trad-core support which is not relavant for microblaze also according to the thread starting here: https://sourceware.org/ml/libc-ports/2013-11/msg00028.html This patch is neither built nor tested but mirrors a MIPS patch that fixes the same issue. Thanks, Matthew * sysdepsysdeps/unix/sysv/linux/microblaze/sys/user.h (PAGE_SHIFT, PAGE_SIZE, PAGE_MASK, NBPG, UPAGES): Remove. (HOST_TEXT_START_ADDR, HOST_STACK_END_ADDR): Remove. Signed-off-by: David Holsgrove <david.holsgrove@xilinx.com>
* MicroBlaze: Remove custom lowlevellock.h.Torvald Riegel2015-01-091-303/+0
| | | | | | | | | 2015-01-06 Torvald Riegel <triegel@redhat.com> * sysdeps/unix/sysv/linux/microblaze/lowlevellock.h: Delete file. Signed-off-by: Torvald Riegel <triegel@redhat.com> Signed-off-by: David Holsgrove <david.holsgrove@xilinx.com>
* MicroBlaze: Remove custom pthread_once implementation on microblaze.Torvald Riegel2015-01-091-89/+0
| | | | | | | | | 2015-01-06 Torvald Riegel <triegel@redhat.com> * sysdeps/unix/sysv/linux/microblaze/pthread_once.c: Delete file. Signed-off-by: Torvald Riegel <triegel@redhat.com> Signed-off-by: David Holsgrove <david.holsgrove@xilinx.com>
* Clean up allocrtsig code.Roland McGrath2015-01-082-82/+0
|
* Add stub sys/procfs.h fileRoland McGrath2015-01-081-1/+1
|
* NPTL: Refactor cpu_set_t validation to be sysdeps-controlledRoland McGrath2015-01-081-0/+48
| | | | | This removes Linuxisms related to cpu_set_t validation from the generic NPTL code and puts them into a new sysdeps header file.
* powerpc: Fix compiler warning on some syscallsAdhemerval Zanella2015-01-084-8/+9
| | | | | | | | | | | | | | | | | GCC 5.0 emits an warning when using sizeof on array function parameters and powerpc internal syscall macros add a check for such cases. More specifically, on powerpc64 and powerpc32 sysdep.h: if (__builtin_classify_type (__arg3) != 5 && sizeof (__arg3) > 8) \ __illegally_sized_syscall_arg3 (); \ And for sysdeps/unix/sysv/linux/utimensat.c build GCC emits: error: ‘sizeof’ on array function parameter ‘tsp’ will return size of ‘const struct timespec *’ This patch uses the address of first struct member instead of the struct itself in syscall macro.