glibc/sysdeps/unix/sysv/linux/m68k
Adhemerval Zanella 045c13d185 Consolidate Linux setrlimit and getrlimit implementation
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 9c96ff2385

	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-11-17 15:54:22 -02:00
..
bits Make padding in struct sockaddr_storage explicit [BZ #20111] 2016-05-23 19:43:09 +02:00
coldfire Add canonicalize, canonicalizef, canonicalizel. 2016-10-26 23:14:31 +00:00
m680x0 Consolidate Linux setrlimit and getrlimit implementation 2016-11-17 15:54:22 -02:00
sys Installed-header hygiene (BZ#20366): stack_t. 2016-09-23 08:43:56 -04:00
____longjmp_chk.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
alphasort64.c Move m68k from ports to libc 2014-02-10 20:22:40 +01:00
arch-fork.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
brk.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
c++-types.data m68k: Consolidate nptl/ subdirectories under linux/... 2014-06-23 09:24:18 -07:00
clone.S m68k: avoid local labels in symbol table 2016-04-30 18:50:39 +02:00
configure Move m68k from ports to libc 2014-02-10 20:22:40 +01:00
configure.ac Move m68k from ports to libc 2014-02-10 20:22:40 +01:00
dl-librecon.h Move m68k from ports to libc 2014-02-10 20:22:40 +01:00
dl-static.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
fcntl.c Move m68k from ports to libc 2014-02-10 20:22:40 +01:00
fxstat.c Move m68k from ports to libc 2014-02-10 20:22:40 +01:00
fxstatat.c Move m68k from ports to libc 2014-02-10 20:22:40 +01:00
getdents64.c Move m68k from ports to libc 2014-02-10 20:22:40 +01:00
getmsg.c Move m68k from ports to libc 2014-02-10 20:22:40 +01:00
getpagesize.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
getsysstats.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
glob64.c Move m68k from ports to libc 2014-02-10 20:22:40 +01:00
Implies NPTL is no longer an add-on! 2014-07-07 09:29:06 -07:00
init-first.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
kernel-features.h Remove __ASSUME_FUTEX_LOCK_PI 2016-06-13 08:36:34 -03:00
ldconfig.h Move m68k from ports to libc 2014-02-10 20:22:40 +01:00
ldsodefs.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
libc-m68k-vdso.c Move m68k from ports to libc 2014-02-10 20:22:40 +01:00
localplt.data m68k: don't expect PLT reference to __tls_get_addr 2014-11-07 17:39:55 +01:00
lockf64.c Move m68k from ports to libc 2014-02-10 20:22:40 +01:00
lxstat.c Whitespace fixes 2014-02-10 20:24:03 +01:00
m68k-helpers.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
m68k-vdso.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
m68k-vdso.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
Makefile Consolidate Linux setrlimit and getrlimit implementation 2016-11-17 15:54:22 -02:00
mmap64.c Move m68k from ports to libc 2014-02-10 20:22:40 +01:00
mmap.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
mremap.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
pt-vfork.c m68k: Consolidate NPTL/non versions of vfork 2014-06-14 21:37:34 +02:00
putmsg.c Move m68k from ports to libc 2014-02-10 20:22:40 +01:00
readdir64_r.c Move m68k from ports to libc 2014-02-10 20:22:40 +01:00
readdir64.c Move m68k from ports to libc 2014-02-10 20:22:40 +01:00
register-dump.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
scandir64.c Move m68k from ports to libc 2014-02-10 20:22:40 +01:00
semtimedop.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
setegid.c Move m68k from ports to libc 2014-02-10 20:22:40 +01:00
seteuid.c Move m68k from ports to libc 2014-02-10 20:22:40 +01:00
setgid.c Move m68k from ports to libc 2014-02-10 20:22:40 +01:00
setgroups.c Move m68k from ports to libc 2014-02-10 20:22:40 +01:00
setregid.c Move m68k from ports to libc 2014-02-10 20:22:40 +01:00
setresgid.c Move m68k from ports to libc 2014-02-10 20:22:40 +01:00
setresuid.c Move m68k from ports to libc 2014-02-10 20:22:40 +01:00
setreuid.c Move m68k from ports to libc 2014-02-10 20:22:40 +01:00
setuid.c Move m68k from ports to libc 2014-02-10 20:22:40 +01:00
sigcontextinfo.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
syscall.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
syscalls.list Fix linux personality syscall wrapper 2015-12-31 00:17:48 +00:00
sysdep-cancel.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
sysdep.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
sysdep.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
Versions Revert {send,sendm,recv,recvm}msg conformance changes 2016-06-10 11:58:16 -03:00
versionsort64.c Move m68k from ports to libc 2014-02-10 20:22:40 +01:00
vfork.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
xstat.c Move m68k from ports to libc 2014-02-10 20:22:40 +01:00