summaryrefslogtreecommitdiff
path: root/sysdeps/unix/sysv/linux/setrlimit64.c
AgeCommit message (Collapse)Author
2018-01-05Alpha: Fix the RLIM_INFINITY and RLIM64_INFINITY constantsAurelien Jarno
Fix the RLIM_INFINITY and RLIM64_INFINITY constants on alpha to match the kernel one and all other architectures. Change the getrlimit, getrlimit64, setrlimit, setrlimit64 into old compat symbols, and provide the Linux generic functions as GLIBC_2_27 version. Changelog: * sysdeps/unix/sysv/linux/getrlimit64.c [USE_VERSIONED_RLIMIT]: Do not define getrlimit and getrlimit64 as weak aliases of __getrlimit64. Define __GI_getrlimit64 as weak alias of __getrlimit64. [__RLIM_T_MATCHES_RLIM64_T]: Do not redefine SHLIB_COMPAT, use #elif instead. * sysdeps/unix/sysv/linux/setrlimit64.c [USE_VERSIONED_RLIMIT]: Do not define setrlimit and setrlimit64 as weak aliases of __setrlimit64. * sysdeps/unix/sysv/linux/alpha/bits/resource.h (RLIM_INFINITY, RLIM64_INFINITY): Fix values to match the kernel ones. * sysdeps/unix/sysv/linux/alpha/getrlimit64.c: Define USE_VERSIONED_RLIMIT. Rename __getrlimit64 into __old_getrlimit64 and provide it as getrlimit@@GLIBC_2_0 and getrlimit64@@GLIBC_2_1. Add a __getrlimit64 function and provide it as getrlimit@@GLIBC_2_27 and getrlimit64@@GLIBC_2_27. * sysdeps/unix/sysv/linux/alpha/setrlimit64.c: Ditto with setrlimit and setrlimit64. * sysdeps/unix/sysv/linux/alpha/libc.abilist (GLIBC_2.27): Add getrlimit, setrlimit, getrlimit64 and setrlimit64. * sysdeps/unix/sysv/linux/alpha/Versions (libc): Add getrlimit, setrlimit, getrlimit64 and setrlimit64.
2018-01-02Fix typos in getrlimit64.c and setrlimit64.cAurelien Jarno
Changelog: * sysdeps/unix/sysv/linux/alpha/getrlimit64.c: Fix a typo in the comment. * sysdeps/unix/sysv/linux/alpha/setrlimit64.c: Fix a typo in the comment. (settrlimit): Rename into setrlimit. (__sttrlimit): Rename into __setrlimit.
2018-01-01Update copyright dates with scripts/update-copyrights.Joseph Myers
* All files with FSF copyright notices: Update copyright dates using scripts/update-copyrights. * locale/programs/charmap-kw.h: Regenerated. * locale/programs/locfile-kw.h: Likewise.
2017-10-01Hide internal __setrlimit function [BZ #18822]H.J. Lu
Hide internal __setrlimit function to allow direct access within libc.so and libc.a without using GOT nor PLT. [BZ #18822] * include/sys/resource.h (__setrlimit): Add libc_hidden_proto. * resource/setrlimit.c (__setrlimit): Add libc_hidden_def. * sysdeps/mach/hurd/setrlimit.c (__setrlimit): Likewise. * sysdeps/unix/sysv/linux/setrlimit.c (__setrlimit): Likewise. * sysdeps/unix/sysv/linux/setrlimit64.c (__GI___setrlimit): New.
2017-05-09Assume prlimit64 is available.Joseph Myers
This patch makes sysdeps/unix/sysv/linux code assume the prlimit64 syscall is always available, given the minimum of a 3.2 kernel. __ASSUME_PRLIMIT64, which in fact was no longer used, is removed. Code conditional on __NR_prlimit64 being defined is made unconditional. Fallback code for the case where prlimit64 produces an ENOSYS error is removed, substantially simplifying some functions. Tested for x86_64 and x86. * sysdeps/unix/sysv/linux/kernel-features.h (__ASSUME_PRLIMIT64): Remove macro. * sysdeps/unix/sysv/linux/getrlimit64.c (__getrlimit64): Assume prlimit64 is always available and does not give an ENOSYS error. * sysdeps/unix/sysv/linux/prlimit.c [__NR_prlimit64]: Make code unconditional. [!__NR_prlimit64]: Remove conditional code. * sysdeps/unix/sysv/linux/setrlimit.c (__setrlimit): Assume prlimit64 is always available and does not give an ENOSYS error. * sysdeps/unix/sysv/linux/setrlimit64.c (__setrlimit64): Likewise.
2017-01-01Update copyright dates with scripts/update-copyrights.Joseph Myers
2016-11-17Consolidate Linux setrlimit and getrlimit implementationAdhemerval Zanella
This patch consolidates all Linux setrlimit and getrlimit on the default sysdeps/unix/sysv/linux/{set,get}rlimit{64}.c. It contains two exceptions: 1. mips32 and mips64n32 which requires a versioned symbol for GLIBC 2.19 and higher due a broken RLIM64_INFINITY constant. 2. sparc32 does not define a compat symbol for getrlimit64 for old 2GB limit. I am not sure if it is required, but a RLIM_INFINITY fix [1] change its definition without adding a compat symbol. This patch does not aim to address this possible issue, it follow current symbol export. The default implementation uses prlimit64 for 64 bit rlim_t ({set,get}rlimit64) and if it fails with ENOSYS it fall back to {get,set}rlimit syscall. This code path is only used on kernel older than 2.6.36 (basically now only x86) and I avoid to user __ASSUME_PRLIMTI64 to simplify the implementation. Once x86 moves to be on par with other architectures regarding minimum kernel supported we can get rid of using old syscalls and default path. A new type size define is added, __RLIM_T_MATCHES_RLIM64_T, where is set as default for 64 bits ports. This allows the default implementation to avoid {get,set}rlimit building and alias {get,set}rlimit64 to {get,set}rlimit. Checked on x86_64, i386, armhf, aarch64, and powerpc64le. I also did a sanity build plus check-abi on all other supported architectures. [1] Commit 9c96ff23858b0759e12ad69e3c4599931c90bee8 Adhemerval Zanella <adhemerval.zanella@linaro.org> Yury Norov <ynorov@caviumnetworks.com> * bits/typesizes.h (__RLIM_T_MATCHES_RLIM64_T): define. * sysdeps/unix/sysv/linux/alpha/bits/typesizes.h (__RLIM_T_MATCHES_RLIM64_T): Likewise. * sysdeps/unix/sysv/linux/generic/bits/typesizes.h (__RLIM_T_MATCHES_RLIM64_T): Likewise. * sysdeps/unix/sysv/linux/s390/bits/typesizes.h [__s390x__] (__RLIM_T_MATCHES_RLIM64_T): Likewise. * sysdeps/unix/sysv/linux/sparc/bits/typesizes.h [__arch64__ || __sparcv9] (__RLIM_T_MATCHES_RLIM64_T): Likewise. * sysdeps/unix/sysv/linux/x86/bits/typesizes.h [__86_64__] (__RLIM_T_MATCHES_RLIM64_T): Likewise. * sysdeps/unix/sysv/linux/arm/Makefile [$(subdir) = resource] (sysdep_routines): Remove oldgetrlimit64. * sysdeps/unix/sysv/linux/i386/Makefile [$(subdir) = resource] (sysdep_routines): Likewise. * sysdeps/unix/sysv/linux/m68k/Makefile [$(subdir) = resource] (sysdep_routines): Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc32/Makefile [$(subdir) = resource] (sysdep_routines): Likewise. * sysdeps/unix/sysv/linux/s390/s390-32/Makefile [$(subdir) = resource] (sysdep_routines): Likewise. * sysdeps/unix/sysv/linux/arm/getrlimit64.c: Remove file. * sysdeps/unix/sysv/linux/arm/oldgetrlimit64.c: Likewise. * sysdeps/unix/sysv/linux/hppa/getrlimit64.c: Likewise. * sysdeps/unix/sysv/linux/i386/getrlimit64.c: Likewise. * sysdeps/unix/sysv/linux/i386/oldgetrlimit64.c: Likewise. * sysdeps/unix/sysv/linux/m68k/getrlimit64.c: Likewise. * sysdeps/unix/sysv/linux/m68k/oldgetrlimit64.c: Likewise. * sysdeps/unix/sysv/linux/powerpc/getrlimit64.c: Likewise. * sysdeps/unix/sysv/linux/powerpc/oldgetrlimit64.c: Likewise. * sysdeps/unix/sysv/linux/s390/s390-32/getrlimit64.c: Likewise. * sysdeps/unix/sysv/linux/s390/s390-32/oldgetrlimit64.c: Likewise. * sysdeps/unix/sysv/linux/sh/getrlimit64.c: Likewise. * sysdeps/unix/sysv/linux/wordsize-64/getrlimit64.c: Likewise. * sysdeps/unix/sysv/linux/wordsize-64/setrlimit64.c: Likewise. * sysdeps/sysv/linux/generic/wordsize-32/syscalls.list: Remove setrlimit and getrlimit. * sysdeps/unix/sysv/linux/hppa/syscalls.list: Likewise. * sysdeps/unix/sysv/linux/i386/syscalls.list: Likewise. * sysdeps/unix/sysv/linux/m68k/m680x0/syscalls.list: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc32/syscalls.list: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc64/syscalls.list: Likewise. * sysdeps/unix/sysv/linux/s390/s390-32/syscalls.list: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc32/syscalls.list: Likewise. * sysdeps/unix/sysv/linux/syscalls.list: Likewise. * sysdeps/unix/sysv/linux/wordsize-64/syscalls.list: Likewise. * sysdeps/unix/sysv/linux/getrlimit.c: New file. * sysdeps/unix/sysv/linux/sparc/getrlimit64.c: Likewise. * sysdeps/unix/sysv/linux/setrlimit.c: Likewise. * sysdeps/unix/sysv/linux/getrlimit64.c (__getrlimit64): Handle __RLIM_T_MATCHES_RLIM64_T and add alias if defined. (__old_getrlimit64): Add compatibility symbol. * sysdeps/unix/sysv/linux/setrlimit64.c (__setrlimit): Likewise.
2016-01-04Update copyright dates with scripts/update-copyrights.Joseph Myers
2015-10-19Convert 231 sysdeps function definitions to prototype style.Joseph Myers
This mostly automatically-generated patch converts 231 sysdeps function definitions in glibc from old-style K&R to prototype-style. For __aio_sigqueue and __gai_sigqueue I had to add internal_function to the definitions as noted by Florian in <https://sourceware.org/ml/libc-alpha/2015-10/msg00595.html> to keep the functions compiling on x86 after conversion to prototype definitions. Otherwise, the patch is automatically generated with all the same exclusions and caveats as in <https://sourceware.org/ml/libc-alpha/2015-10/msg00594.html> except that it's a patch for sysdeps files. Tested for x86_64 and x86 (testsuite, and that installed stripped shared libraries are unchanged by the patch). Also tested for arm, mips64 and powerpc32 that installed stripped shared libraries are unchanged by the patch. * sysdeps/arm/backtrace.c (__backtrace): Convert to prototype-style function definition. * sysdeps/i386/backtrace.c (__backtrace): Likewise. * sysdeps/i386/ffs.c (__ffs): Likewise. * sysdeps/i386/i686/ffs.c (__ffs): Likewise. * sysdeps/ia64/nptl/pthread_spin_lock.c (pthread_spin_lock): Likewise. * sysdeps/ia64/nptl/pthread_spin_trylock.c (pthread_spin_trylock): Likewise. * sysdeps/ieee754/ldbl-128/e_log2l.c (__ieee754_log2l): Likewise. * sysdeps/ieee754/ldbl-128ibm/e_log2l.c (__ieee754_log2l): Likewise. * sysdeps/m68k/ffs.c (__ffs): Likewise. * sysdeps/m68k/m680x0/fpu/e_acos.c (FUNC): Likewise. * sysdeps/m68k/m680x0/fpu/e_fmod.c (FUNC): Likewise. * sysdeps/mach/adjtime.c (__adjtime): Likewise. * sysdeps/mach/gettimeofday.c (__gettimeofday): Likewise. * sysdeps/mach/hurd/_exit.c (_exit): Likewise. * sysdeps/mach/hurd/access.c (__access): Likewise. * sysdeps/mach/hurd/adjtime.c (__adjtime): Likewise. * sysdeps/mach/hurd/chdir.c (__chdir): Likewise. * sysdeps/mach/hurd/chmod.c (__chmod): Likewise. * sysdeps/mach/hurd/chown.c (__chown): Likewise. * sysdeps/mach/hurd/cthreads.c (cthread_keycreate): Likewise. (cthread_getspecific): Likewise. (cthread_setspecific): Likewise. (__libc_getspecific): Likewise. * sysdeps/mach/hurd/euidaccess.c (__euidaccess): Likewise. * sysdeps/mach/hurd/faccessat.c (faccessat): Likewise. * sysdeps/mach/hurd/fchdir.c (__fchdir): Likewise. * sysdeps/mach/hurd/fchmod.c (__fchmod): Likewise. * sysdeps/mach/hurd/fchmodat.c (fchmodat): Likewise. * sysdeps/mach/hurd/fchown.c (__fchown): Likewise. * sysdeps/mach/hurd/fchownat.c (fchownat): Likewise. * sysdeps/mach/hurd/flock.c (__flock): Likewise. * sysdeps/mach/hurd/fsync.c (fsync): Likewise. * sysdeps/mach/hurd/ftruncate.c (__ftruncate): Likewise. * sysdeps/mach/hurd/getgroups.c (__getgroups): Likewise. * sysdeps/mach/hurd/gethostname.c (__gethostname): Likewise. * sysdeps/mach/hurd/getitimer.c (__getitimer): Likewise. * sysdeps/mach/hurd/getlogin_r.c (__getlogin_r): Likewise. * sysdeps/mach/hurd/getpgid.c (__getpgid): Likewise. * sysdeps/mach/hurd/getrusage.c (__getrusage): Likewise. * sysdeps/mach/hurd/getsockname.c (__getsockname): Likewise. * sysdeps/mach/hurd/group_member.c (__group_member): Likewise. * sysdeps/mach/hurd/isatty.c (__isatty): Likewise. * sysdeps/mach/hurd/lchown.c (__lchown): Likewise. * sysdeps/mach/hurd/link.c (__link): Likewise. * sysdeps/mach/hurd/linkat.c (linkat): Likewise. * sysdeps/mach/hurd/listen.c (__listen): Likewise. * sysdeps/mach/hurd/mkdir.c (__mkdir): Likewise. * sysdeps/mach/hurd/mkdirat.c (mkdirat): Likewise. * sysdeps/mach/hurd/openat.c (__openat): Likewise. * sysdeps/mach/hurd/poll.c (__poll): Likewise. * sysdeps/mach/hurd/readlink.c (__readlink): Likewise. * sysdeps/mach/hurd/readlinkat.c (readlinkat): Likewise. * sysdeps/mach/hurd/recv.c (__recv): Likewise. * sysdeps/mach/hurd/rename.c (rename): Likewise. * sysdeps/mach/hurd/renameat.c (renameat): Likewise. * sysdeps/mach/hurd/revoke.c (revoke): Likewise. * sysdeps/mach/hurd/rewinddir.c (__rewinddir): Likewise. * sysdeps/mach/hurd/rmdir.c (__rmdir): Likewise. * sysdeps/mach/hurd/seekdir.c (seekdir): Likewise. * sysdeps/mach/hurd/send.c (__send): Likewise. * sysdeps/mach/hurd/setdomain.c (setdomainname): Likewise. * sysdeps/mach/hurd/setegid.c (setegid): Likewise. * sysdeps/mach/hurd/seteuid.c (seteuid): Likewise. * sysdeps/mach/hurd/setgid.c (__setgid): Likewise. * sysdeps/mach/hurd/setgroups.c (setgroups): Likewise. * sysdeps/mach/hurd/sethostid.c (sethostid): Likewise. * sysdeps/mach/hurd/sethostname.c (sethostname): Likewise. * sysdeps/mach/hurd/setlogin.c (setlogin): Likewise. * sysdeps/mach/hurd/setpgid.c (__setpgid): Likewise. * sysdeps/mach/hurd/setregid.c (__setregid): Likewise. * sysdeps/mach/hurd/setreuid.c (__setreuid): Likewise. * sysdeps/mach/hurd/settimeofday.c (__settimeofday): Likewise. * sysdeps/mach/hurd/setuid.c (__setuid): Likewise. * sysdeps/mach/hurd/shutdown.c (shutdown): Likewise. * sysdeps/mach/hurd/sigaction.c (__sigaction): Likewise. * sysdeps/mach/hurd/sigaltstack.c (__sigaltstack): Likewise. * sysdeps/mach/hurd/sigpending.c (sigpending): Likewise. * sysdeps/mach/hurd/sigprocmask.c (__sigprocmask): Likewise. * sysdeps/mach/hurd/sigsuspend.c (__sigsuspend): Likewise. * sysdeps/mach/hurd/socket.c (__socket): Likewise. * sysdeps/mach/hurd/symlink.c (__symlink): Likewise. * sysdeps/mach/hurd/symlinkat.c (symlinkat): Likewise. * sysdeps/mach/hurd/telldir.c (telldir): Likewise. * sysdeps/mach/hurd/truncate.c (__truncate): Likewise. * sysdeps/mach/hurd/umask.c (__umask): Likewise. * sysdeps/mach/hurd/unlink.c (__unlink): Likewise. * sysdeps/mach/hurd/unlinkat.c (unlinkat): Likewise. * sysdeps/mips/mips64/__longjmp.c (__longjmp): Likewise. * sysdeps/posix/alarm.c (alarm): Likewise. * sysdeps/posix/cuserid.c (cuserid): Likewise. * sysdeps/posix/dirfd.c (dirfd): Likewise. * sysdeps/posix/dup.c (__dup): Likewise. * sysdeps/posix/dup2.c (__dup2): Likewise. * sysdeps/posix/euidaccess.c (euidaccess): Likewise. (main): Likewise. * sysdeps/posix/flock.c (__flock): Likewise. * sysdeps/posix/fpathconf.c (__fpathconf): Likewise. * sysdeps/posix/getcwd.c (__getcwd): Likewise. * sysdeps/posix/gethostname.c (__gethostname): Likewise. * sysdeps/posix/gettimeofday.c (__gettimeofday): Likewise. * sysdeps/posix/isatty.c (__isatty): Likewise. * sysdeps/posix/killpg.c (killpg): Likewise. * sysdeps/posix/libc_fatal.c (__libc_fatal): Likewise. * sysdeps/posix/mkfifoat.c (mkfifoat): Likewise. * sysdeps/posix/raise.c (raise): Likewise. * sysdeps/posix/remove.c (remove): Likewise. * sysdeps/posix/rename.c (rename): Likewise. * sysdeps/posix/rewinddir.c (__rewinddir): Likewise. * sysdeps/posix/seekdir.c (seekdir): Likewise. * sysdeps/posix/sigblock.c (__sigblock): Likewise. * sysdeps/posix/sigignore.c (sigignore): Likewise. * sysdeps/posix/sigintr.c (siginterrupt): Likewise. * sysdeps/posix/signal.c (__bsd_signal): Likewise. * sysdeps/posix/sigset.c (sigset): Likewise. * sysdeps/posix/sigsuspend.c (__sigsuspend): Likewise. * sysdeps/posix/sysconf.c (__sysconf): Likewise. * sysdeps/posix/sysv_signal.c (__sysv_signal): Likewise. * sysdeps/posix/time.c (time): Likewise. * sysdeps/posix/ttyname.c (getttyname): Likewise. (ttyname): Likewise. * sysdeps/posix/ttyname_r.c (__ttyname_r): Likewise. * sysdeps/posix/utime.c (utime): Likewise. * sysdeps/powerpc/fpu/s_isnan.c (__isnan): Likewise. * sysdeps/powerpc/nptl/pthread_spin_lock.c (pthread_spin_lock): Likewise. * sysdeps/powerpc/nptl/pthread_spin_trylock.c (pthread_spin_trylock): Likewise. * sysdeps/pthread/aio_error.c (aio_error): Likewise. * sysdeps/pthread/aio_read.c (aio_read): Likewise. * sysdeps/pthread/aio_read64.c (aio_read64): Likewise. * sysdeps/pthread/aio_write.c (aio_write): Likewise. * sysdeps/pthread/aio_write64.c (aio_write64): Likewise. * sysdeps/pthread/flockfile.c (__flockfile): Likewise. * sysdeps/pthread/ftrylockfile.c (__ftrylockfile): Likewise. * sysdeps/pthread/funlockfile.c (__funlockfile): Likewise. * sysdeps/pthread/timer_create.c (timer_create): Likewise. * sysdeps/pthread/timer_getoverr.c (timer_getoverrun): Likewise. * sysdeps/pthread/timer_gettime.c (timer_gettime): Likewise. * sysdeps/s390/ffs.c (__ffs): Likewise. * sysdeps/s390/nptl/pthread_spin_lock.c (pthread_spin_lock): Likewise. * sysdeps/s390/nptl/pthread_spin_trylock.c (pthread_spin_trylock): Likewise. * sysdeps/sh/nptl/pthread_spin_lock.c (pthread_spin_lock): Likewise. * sysdeps/sparc/nptl/pthread_barrier_destroy.c (pthread_barrier_destroy): Likewise. * sysdeps/sparc/nptl/pthread_barrier_wait.c (__pthread_barrier_wait): Likewise. * sysdeps/sparc/sparc32/e_sqrt.c (__ieee754_sqrt): Likewise. * sysdeps/sparc/sparc32/pthread_barrier_wait.c (__pthread_barrier_wait): Likewise. * sysdeps/sparc/sparc32/sem_init.c (__old_sem_init): Likewise. * sysdeps/tile/memcmp.c (memcmp_common_alignment): Likewise. (memcmp_not_common_alignment): Likewise. (MEMCMP): Likewise. * sysdeps/tile/wordcopy.c (_wordcopy_fwd_aligned): Likewise. (_wordcopy_fwd_dest_aligned): Likewise. (_wordcopy_bwd_aligned): Likewise. (_wordcopy_bwd_dest_aligned): Likewise. * sysdeps/unix/bsd/ftime.c (ftime): Likewise. * sysdeps/unix/bsd/gtty.c (gtty): Likewise. * sysdeps/unix/bsd/stty.c (stty): Likewise. * sysdeps/unix/bsd/tcflow.c (tcflow): Likewise. * sysdeps/unix/bsd/tcflush.c (tcflush): Likewise. * sysdeps/unix/bsd/tcgetattr.c (__tcgetattr): Likewise. * sysdeps/unix/bsd/tcgetpgrp.c (tcgetpgrp): Likewise. * sysdeps/unix/bsd/tcsendbrk.c (tcsendbreak): Likewise. * sysdeps/unix/bsd/tcsetattr.c (tcsetattr): Likewise. * sysdeps/unix/bsd/tcsetpgrp.c (tcsetpgrp): Likewise. * sysdeps/unix/bsd/ualarm.c (ualarm): Likewise. * sysdeps/unix/bsd/wait3.c (__wait3): Likewise. * sysdeps/unix/getlogin_r.c (__getlogin_r): Likewise. * sysdeps/unix/sockatmark.c (sockatmark): Likewise. * sysdeps/unix/stime.c (stime): Likewise. * sysdeps/unix/sysv/linux/_exit.c (_exit): Likewise. * sysdeps/unix/sysv/linux/aio_sigqueue.c (__aio_sigqueue): Likewise. Use internal_function. * sysdeps/unix/sysv/linux/arm/sigaction.c (__libc_sigaction): Convert to prototype-style function definition. * sysdeps/unix/sysv/linux/faccessat.c (faccessat): Likewise. * sysdeps/unix/sysv/linux/fchmodat.c (fchmodat): Likewise. * sysdeps/unix/sysv/linux/fpathconf.c (__fpathconf): Likewise. * sysdeps/unix/sysv/linux/gai_sigqueue.c (__gai_sigqueue): Likewise. Use internal_function. * sysdeps/unix/sysv/linux/gethostid.c (sethostid): Convert to prototype-style function definition * sysdeps/unix/sysv/linux/getlogin_r.c (__getlogin_r_loginuid): Likewise. (__getlogin_r): Likewise. * sysdeps/unix/sysv/linux/getpt.c (__posix_openpt): Likewise. * sysdeps/unix/sysv/linux/hppa/pthread_cond_broadcast.c (__pthread_cond_broadcast): Likewise. * sysdeps/unix/sysv/linux/hppa/pthread_cond_destroy.c (__pthread_cond_destroy): Likewise. * sysdeps/unix/sysv/linux/hppa/pthread_cond_init.c (__pthread_cond_init): Likewise. * sysdeps/unix/sysv/linux/hppa/pthread_cond_signal.c (__pthread_cond_signal): Likewise. * sysdeps/unix/sysv/linux/hppa/pthread_cond_wait.c (__pthread_cond_wait): Likewise. * sysdeps/unix/sysv/linux/i386/getmsg.c (getmsg): Likewise. * sysdeps/unix/sysv/linux/i386/setegid.c (setegid): Likewise. * sysdeps/unix/sysv/linux/ia64/sigaction.c (__libc_sigaction): Likewise. * sysdeps/unix/sysv/linux/ia64/sigpending.c (sigpending): Likewise. * sysdeps/unix/sysv/linux/ia64/sigprocmask.c (__sigprocmask): Likewise. * sysdeps/unix/sysv/linux/mips/sigaction.c (__libc_sigaction): Likewise. * sysdeps/unix/sysv/linux/msgget.c (msgget): Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc32/ftruncate64.c (__ftruncate64): Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc32/truncate64.c (truncate64): Likewise. * sysdeps/unix/sysv/linux/pt-raise.c (raise): Likewise. * sysdeps/unix/sysv/linux/pthread_getcpuclockid.c (pthread_getcpuclockid): Likewise. * sysdeps/unix/sysv/linux/pthread_getname.c (pthread_getname_np): Likewise. * sysdeps/unix/sysv/linux/pthread_setname.c (pthread_setname_np): Likewise. * sysdeps/unix/sysv/linux/pthread_sigmask.c (pthread_sigmask): Likewise. * sysdeps/unix/sysv/linux/pthread_sigqueue.c (pthread_sigqueue): Likewise. * sysdeps/unix/sysv/linux/raise.c (raise): Likewise. * sysdeps/unix/sysv/linux/s390/s390-64/sigaction.c (__libc_sigaction): Likewise. * sysdeps/unix/sysv/linux/s390/s390-64/sigpending.c (sigpending): Likewise. * sysdeps/unix/sysv/linux/s390/s390-64/sigprocmask.c (__sigprocmask): Likewise. * sysdeps/unix/sysv/linux/semget.c (semget): Likewise. * sysdeps/unix/sysv/linux/semop.c (semop): Likewise. * sysdeps/unix/sysv/linux/setrlimit64.c (setrlimit64): Likewise. * sysdeps/unix/sysv/linux/shmat.c (shmat): Likewise. * sysdeps/unix/sysv/linux/shmdt.c (shmdt): Likewise. * sysdeps/unix/sysv/linux/shmget.c (shmget): Likewise. * sysdeps/unix/sysv/linux/sigaction.c (__libc_sigaction): Likewise. * sysdeps/unix/sysv/linux/sigpending.c (sigpending): Likewise. * sysdeps/unix/sysv/linux/sigprocmask.c (__sigprocmask): Likewise. * sysdeps/unix/sysv/linux/sigqueue.c (__sigqueue): Likewise. * sysdeps/unix/sysv/linux/sigstack.c (sigstack): Likewise. * sysdeps/unix/sysv/linux/sparc/sparc64/sigpending.c (sigpending): Likewise. * sysdeps/unix/sysv/linux/sparc/sparc64/sigprocmask.c (__sigprocmask): Likewise. * sysdeps/unix/sysv/linux/speed.c (cfgetospeed): Likewise. (cfgetispeed): Likewise. (cfsetospeed): Likewise. (cfsetispeed): Likewise. * sysdeps/unix/sysv/linux/tcflow.c (tcflow): Likewise. * sysdeps/unix/sysv/linux/tcflush.c (tcflush): Likewise. * sysdeps/unix/sysv/linux/tcgetattr.c (__tcgetattr): Likewise. * sysdeps/unix/sysv/linux/tcsetattr.c (tcsetattr): Likewise. * sysdeps/unix/sysv/linux/time.c (time): Likewise. * sysdeps/unix/sysv/linux/timer_create.c (timer_create): Likewise. * sysdeps/unix/sysv/linux/timer_delete.c (timer_delete): Likewise. * sysdeps/unix/sysv/linux/timer_getoverr.c (timer_getoverrun): Likewise. * sysdeps/unix/sysv/linux/timer_gettime.c (timer_gettime): Likewise. * sysdeps/unix/sysv/linux/x86_64/sigpending.c (sigpending): Likewise. * sysdeps/unix/sysv/linux/x86_64/sigprocmask.c (__sigprocmask): Likewise. * sysdeps/x86_64/backtrace.c (__backtrace): Likewise.
2015-08-21Revert "Add INLINE_SYSCALL_RETURN/INLINE_SYSCALL_ERROR_RETURN"H.J. Lu
This reverts commit 0c5b8b5941e036dcaac69cecee9f01fdf9218e6e.
2015-08-21Add INLINE_SYSCALL_RETURN/INLINE_SYSCALL_ERROR_RETURNH.J. Lu
For ia32 PIC, the first thing of many syscalls does is to call __x86.get_pc_thunk.reg to load PC into reg in case there is an error, which is required for setting errno. In most cases, there are no errors. But we still call __x86.get_pc_thunk.reg. This patch adds INLINE_SYSCALL_RETURN and INLINE_SYSCALL_ERROR_RETURN so that i386 can optimize setting errno by branching to the internal __syscall_error without PLT. INLINE_SYSCALL_ERROR_RETURN is designed to take the negative error number returned from the majority of Linux kernels for which negating is a no-op with INTERNAL_SYSCALL_ERRNO. With i386 INLINE_SYSCALL_RETURN, INLINE_SYSCALL_ERROR_RETURN and i386 syscall inlining optimization for GCC 5, for sysdeps/unix/sysv/linux/fchmodat.c with -O2 -march=i686 -mtune=generic, GCC 5.2 now generates: <fchmodat>: 0: push %ebx 1: mov 0x14(%esp),%eax 5: mov 0x8(%esp),%ebx 9: mov 0xc(%esp),%ecx d: mov 0x10(%esp),%edx 11: test $0xfffffeff,%eax 16: jne 38 <fchmodat+0x38> 18: test $0x1,%ah 1b: jne 48 <fchmodat+0x48> 1d: mov $0x132,%eax 22: call *%gs:0x10 29: cmp $0xfffff000,%eax 2e: ja 58 <fchmodat+0x58> 30: pop %ebx 31: ret 32: lea 0x0(%esi),%esi 38: pop %ebx 39: mov $0xffffffea,%eax 3e: jmp 3f <fchmodat+0x3f> 3f: R_386_PC32 __syscall_error 43: nop 44: lea 0x0(%esi,%eiz,1),%esi 48: pop %ebx 49: mov $0xffffffa1,%eax 4e: jmp 4f <fchmodat+0x4f> 4f: R_386_PC32 __syscall_error 53: nop 54: lea 0x0(%esi,%eiz,1),%esi 58: pop %ebx 59: jmp 5a <fchmodat+0x5a> 5a: R_386_PC32 __syscall_error instead of <fchmodat>: 0: sub $0x8,%esp 3: mov 0x18(%esp),%eax 7: mov %ebx,(%esp) a: call b <fchmodat+0xb> b: R_386_PC32 __x86.get_pc_thunk.bx f: add $0x2,%ebx 11: R_386_GOTPC _GLOBAL_OFFSET_TABLE_ 15: mov %edi,0x4(%esp) 19: test $0xfffffeff,%eax 1e: jne 70 <fchmodat+0x70> 20: test $0x1,%ah 23: jne 88 <fchmodat+0x88> 25: mov 0x14(%esp),%edx 29: mov 0x10(%esp),%ecx 2d: mov 0xc(%esp),%edi 31: xchg %ebx,%edi 33: mov $0x132,%eax 38: call *%gs:0x10 3f: xchg %edi,%ebx 41: cmp $0xfffff000,%eax 46: ja 58 <fchmodat+0x58> 48: mov (%esp),%ebx 4b: mov 0x4(%esp),%edi 4f: add $0x8,%esp 52: ret 53: nop 54: lea 0x0(%esi,%eiz,1),%esi 58: mov 0x0(%ebx),%edx 5a: R_386_TLS_GOTIE __libc_errno 5e: neg %eax 60: mov %eax,%gs:(%edx) 63: mov $0xffffffff,%eax 68: jmp 48 <fchmodat+0x48> 6a: lea 0x0(%esi),%esi 70: mov 0x0(%ebx),%eax 72: R_386_TLS_GOTIE __libc_errno 76: movl $0x16,%gs:(%eax) 7d: mov $0xffffffff,%eax 82: jmp 48 <fchmodat+0x48> 84: lea 0x0(%esi,%eiz,1),%esi 88: mov 0x0(%ebx),%eax 8a: R_386_TLS_GOTIE __libc_errno 8e: movl $0x5f,%gs:(%eax) 95: mov $0xffffffff,%eax 9a: jmp 48 <fchmodat+0x48> * sysdeps/unix/sysdep.h (INLINE_SYSCALL_RETURN): New. (INLINE_SYSCALL_ERROR_RETURN): Likewise. * sysdeps/unix/sysv/linux/adjtime.c (ADJTIME): Use INLINE_SYSCALL_RETURN and INLINE_SYSCALL_ERROR_RETURN. * sysdeps/unix/sysv/linux/aio_sigqueue.c (__aio_sigqueue): Likewise. * sysdeps/unix/sysv/linux/dl-openat64.c (openat64): Likewise. * sysdeps/unix/sysv/linux/eventfd.c (eventfd): Likewise. * sysdeps/unix/sysv/linux/faccessat.c (faccessat): Likewise. * sysdeps/unix/sysv/linux/fchmodat.c (fchmodat): Likewise. * sysdeps/unix/sysv/linux/fcntl.c (do_fcntl): Likewise. * sysdeps/unix/sysv/linux/fstatfs64.c (__fstatfs64): Likewise. * sysdeps/unix/sysv/linux/ftruncate64.c (__ftruncate64): Likewise. * sysdeps/unix/sysv/linux/futimens.c (futimens): Likewise. * sysdeps/unix/sysv/linux/futimes.c (__futimes): Likewise. * sysdeps/unix/sysv/linux/futimesat.c (futimesat): Likewise. * sysdeps/unix/sysv/linux/fxstat.c (__fxstat): Likewise. * sysdeps/unix/sysv/linux/fxstat64.c (___fxstat64): Likewise. * sysdeps/unix/sysv/linux/fxstatat.c (__fxstatat): Likewise. * sysdeps/unix/sysv/linux/fxstatat64.c (__fxstatat64): Likewise. * sysdeps/unix/sysv/linux/gai_sigqueue.c (__gai_sigqueue): Likewise. * sysdeps/unix/sysv/linux/getpriority.c (__getpriority): Likewise. * sysdeps/unix/sysv/linux/getrlimit64.c (__getrlimit64): Likewise. * sysdeps/unix/sysv/linux/llseek.c (__llseek): Likewise. * sysdeps/unix/sysv/linux/lutimes.c (lutimes): Likewise. * sysdeps/unix/sysv/linux/lxstat.c (__lxstat): Likewise. * sysdeps/unix/sysv/linux/lxstat64.c (___lxstat64): Likewise. * sysdeps/unix/sysv/linux/mmap64.c (__mmap64): Likewise. * sysdeps/unix/sysv/linux/mq_close.c (mq_close): Likewise. * sysdeps/unix/sysv/linux/mq_open.c (__mq_open): Likewise. * sysdeps/unix/sysv/linux/mq_unlink.c (mq_unlink): Likewise. * sysdeps/unix/sysv/linux/msgget.c (msgget): Likewise. * sysdeps/unix/sysv/linux/prlimit.c (prlimit): Likewise. * sysdeps/unix/sysv/linux/pt-raise.c (raise): Likewise. * sysdeps/unix/sysv/linux/raise.c (raise): Likewise. * sysdeps/unix/sysv/linux/readahead.c (__readahead): Likewise. * sysdeps/unix/sysv/linux/reboot.c (reboot): Likewise. * sysdeps/unix/sysv/linux/semget.c (semget): Likewise. * sysdeps/unix/sysv/linux/semop.c (semop): Likewise. * sysdeps/unix/sysv/linux/semtimedop.c (semtimedop): Likewise. * sysdeps/unix/sysv/linux/setrlimit64.c (setrlimit64): Likewise. * sysdeps/unix/sysv/linux/shmat.c (shmat): Likewise. * sysdeps/unix/sysv/linux/shmdt.c (shmdt): Likewise. * sysdeps/unix/sysv/linux/shmget.c (shmget): Likewise. * sysdeps/unix/sysv/linux/signalfd.c (signalfd): Likewise. * sysdeps/unix/sysv/linux/sigpending.c (sigpending): Likewise. * sysdeps/unix/sysv/linux/sigprocmask.c ( __sigprocmask): Likewise. * sysdeps/unix/sysv/linux/sigqueue.c (__sigqueue): Likewise. * sysdeps/unix/sysv/linux/speed.c (cfsetospeed): Likewise. * sysdeps/unix/sysv/linux/statfs64.c (__statfs64): Likewise. * sysdeps/unix/sysv/linux/sysctl.c (__sysctl): Likewise. * sysdeps/unix/sysv/linux/tcsendbrk.c (tcsendbreak): Likewise. * sysdeps/unix/sysv/linux/tcsetattr.c (tcsetattr): Likewise. * sysdeps/unix/sysv/linux/timer_getoverr.c (timer_getoverrun): Likewise. * sysdeps/unix/sysv/linux/timer_gettime.c (timer_gettime): Likewise. * sysdeps/unix/sysv/linux/timer_settime.c (timer_settime): Likewise. * sysdeps/unix/sysv/linux/truncate64.c (truncate64): Likewise. * sysdeps/unix/sysv/linux/ustat.c (ustat): Likewise. * sysdeps/unix/sysv/linux/utimensat.c (utimensat): Likewise. * sysdeps/unix/sysv/linux/utimes.c (__utimes): Likewise. * sysdeps/unix/sysv/linux/xmknod.c (__xmknod): Likewise. * sysdeps/unix/sysv/linux/xmknodat.c (__xmknodat): Likewise. * sysdeps/unix/sysv/linux/xstat.c (__xstat): Likewise. * sysdeps/unix/sysv/linux/xstat64.c (___xstat64): Likewise. * sysdeps/unix/sysv/linux/xstatconv.c (__xstat_conv): Likewise. (__xstat64_conv): Likewise. (__xstat32_conv): Likewise. * sysdeps/unix/sysv/linux/sched_getaffinity.c (__sched_getaffinity_new): Add libc_hidden_proto and libc_hidden_def. Use INLINE_SYSCALL_ERROR_RETURN.
2015-01-02Update copyright dates with scripts/update-copyrights.Joseph Myers
2014-01-01Update copyright notices with scripts/update-copyrightsAllan McRae
2013-01-02Update copyright notices with scripts/update-copyrights.Joseph Myers
2012-02-09Replace FSF snail mail address with URLs.Paul Eggert
2010-12-25Use prlimit64 for 32-bit [gs]etrlimit64 implementation.Ulrich Drepper
1999-12-18Update.Ulrich Drepper
1999-12-17 Ulrich Drepper <drepper@cygnus.com> * string/bits/string2.h (__strtok_r_1c): Help gcc optimizing string access. * locale/programs/ld-collate.c: Implement handling of absolute ellipsis. Parsing of file and constructing the internal data structures should now be complete. (collate_finish): Start adding support to generate the data structures which are written out to the file. * intl/dcgettext.c: Rewrite to handle caching of previous results here instead of in the dcgettext macro. * intl/libintl.h (dcgettext): Don't define for systems using this glibc or systems with tsearch. * sysdeps/generic/mathdef.h: Protect definitions for math.h against double inclusion. * sysdeps/alpha/fpu/bits/mathdef.h: Likewise. * sysdeps/i386/fpu/bits/mathdef.h: Likewise. * sysdeps/m68k/fpu/bits/mathdef.h: Likewise. * sysdeps/powerpc/fpu/bits/mathdef.h: Likewise. * sysdeps/i386/fpu/libm-test-ulps: Add more deltas (are mobile PIIs that different?). 1999-12-17 Andreas Jaeger <aj@suse.de> * rt/aio.h (struct aiocb64): Add member __next_prio to sync the struct with aiocb. * rt/Makefile (tests): Added tst-aio64. Added dependency rules for tst-aio64. * rt/tst-aio64.c: New file, copied from tst-aio.c and changed for 64bit tests. 1999-12-15 Thorsten Kukuk <kukuk@suse.de> * sysdeps/unix/sysv/linux/alpha/oldgetrlimit64.c: Removed. * sysdeps/unix/sysv/linux/alpha/oldsetrlimit64.c: Removed. * sysdeps/unix/sysv/linux/bits/resource.h: Change RLIM_INFINITY back to old value (signed long). * sysdeps/unix/sysv/linux/i386/bits/resource.h: New, with unsigned long RLIM_INFINITY. * sysdeps/unix/sysv/linux/getrlimit.c: Moved from here to ... * sysdeps/unix/sysv/linux/i386/getrlimit.c: ... here. * sysdeps/unix/sysv/linux/getrlimit64.c: Moved from here to ... * sysdeps/unix/sysv/linux/i386/getrlimit64.c: ... here. * sysdeps/unix/sysv/linux/oldgetrlimit64.c: Moved from here to ... * sysdeps/unix/sysv/linux/i386/oldgetrlimit64.c: ... here. * sysdeps/unix/sysv/linux/oldsetrlimit64.c: Moved from here to ... * sysdeps/unix/sysv/linux/i386/oldsetrlimit64.c: ... here. * sysdeps/unix/sysv/linux/setrlimit.c: Moved from here to ... * sysdeps/unix/sysv/linux/i386/setrlimit.c: ... here. * sysdeps/unix/sysv/linux/setrlimit64.c: Moved from here to ... * sysdeps/unix/sysv/linux/i386/setrlimit64.c: ... here. * sysdeps/unix/sysv/linux/sparc/bits/resource.h: New. * sysdeps/unix/sysv/linux/sparc/sparc64/oldgetrlimit64.c: Removed. * sysdeps/unix/sysv/linux/sparc/sparc64/oldsetrlimit64.c: Removed. 1999-12-17 Andreas Jaeger <aj@suse.de> * elf/ldconfig.c: Add new option -l to manualy link shared libraries. (options): Added option. (parse_opt): Set option. (main): Handle option. (manual_link): New function. 1999-12-17 Thorsten Kukuk <kukuk@suse.de> * string/bits/string2.h: Fix patch from 1999-12-07. 1999-12-16 Ulrich Drepper <drepper@cygnus.com> * sysdeps/generic/strsep.c: If delim string has only one character don't run over end of string. * locale/programs/ld-collate.c (insert_weights): Also update next pointer of last cursor element. (insert_value): Return nonzero value if nothing got inserted. (handle_ellipsis): Don't do anything if to-value cannot be inserted. 1999-12-10 Jakub Jelinek <jakub@redhat.com> * stdlib/longlong.h (__sparc_v9__): Use %rDIGIT instead of %DIGIT where appropriate. 1999-12-10 Jakub Jelinek <jakub@redhat.com> * sysdeps/unix/sysv/linux/sparc/sparc64/sigaction.c (__sigaction): Copy sa_flags into kernel sigaction structure. 1999-12-14 Andreas Jaeger <aj@suse.de> * string/tester.c (test_strsep): More tests for access beyond the final NUL. The first two tests come from PR libc/1486 by martinea@iro.umontreal.ca. 1999-12-14 Thorsten Kukuk <kukuk@suse.de> * nis/ypclnt.c: Correct handling of cached client handles. (__xdr_ypresp_all): Call callback function for errors, too, like Solaris does. * nis/nss_compat/compat-grp.c: Make sure errno is always set correct. * nis/nss_compat/compat-initgroups.c: Likewise. * nis/nss_compat/compat-spwd.c: Likewise. * nis/nss_nis/nis-alias.c: Likewise. * nis/nss_nis/nis-ethers.c: Likewise. * nis/nss_nis/nis-grp.c: Likewise. * nis/nss_nis/nis-hosts.c: Likewise. * nis/nss_nis/nis-netgrp.c: Likewise. * nis/nss_nis/nis-publickey.c: Likewise. * nis/nss_nis/nis-service.c: Likewise. Also use services.byservicename Map if available, optimize query if name/port and protocol is known.
1999-12-02Update.Ulrich Drepper
1999-12-01 Andreas Jaeger <aj@suse.de> * sysdeps/generic/if_index.c (__protocol_available): Add missing int for parameter. * stdio/stdio.h: Fix typo. Patches by Marcus G. Daniels <mgd@santafe.edu>. 1999-12-01 Andreas Jaeger <aj@suse.de> * scripts/test-installation.pl (installation_problem): Filter out libpthread_db. 1999-12-01 Andreas Schwab <schwab@suse.de> * sysdeps/unix/sysv/linux/alpha/bits/types.h: Fix signedness of __rlim_t and __rlim64_t. * sysdeps/unix/sysv/linux/mips/bits/types.h: Likewise. * sysdeps/unix/sysv/linux/sparc/bits/types.h: Likewise. 1999-12-01 Andreas Schwab <schwab@suse.de> * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Add oldgetrlimit64 and oldsetrlimit64 for subdir = resource. * sysdeps/unix/sysv/linux/Versions: Add getrlimit, setrlimit, getrlimit64 and setrlimit64 to version GLIBC_2.1.3. * sysdeps/unix/sysv/linux/setrlimit.c: Correct handling of old and new kernel version. Add symbol versions. * sysdeps/unix/sysv/linux/syscalls.list: Add oldsetrlimit and oldgetrlimit. * sysdeps/unix/sysv/linux/alpha/syscalls.list: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list: Likewise. * sysdeps/unix/sysv/linux/powerpc/syscalls.list: Add s_getrlimit and s_ugetrlimit. * sysdeps/unix/sysv/linux/sparc/sparc32/syscalls.list: Likewise. * sysdeps/unix/sysv/linux/getrlimit.c: New file. * sysdeps/unix/sysv/linux/getrlimit64.c: New file. * sysdeps/unix/sysv/linux/oldgetrlimit64.c: New file. * sysdeps/unix/sysv/linux/oldsetrlimit64.c: New file. * sysdeps/unix/sysv/linux/setrlimit64.c: New file. * sysdeps/unix/sysv/linux/alpha/oldgetrlimit64.c: New file. * sysdeps/unix/sysv/linux/alpha/oldsetrlimit64.c: New file. * sysdeps/unix/sysv/linux/sparc/sparc64/oldgetrlimit64.c: New file. * sysdeps/unix/sysv/linux/sparc/sparc64/oldsetrlimit64.c: New file.