Commit Graph

21 Commits

Author SHA1 Message Date
Joseph Myers 04277e02d7 Update copyright dates with scripts/update-copyrights.
* 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.
2019-01-01 00:11:28 +00:00
Joseph Myers 688903eb3e Update copyright dates with scripts/update-copyrights.
* 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.
2018-01-01 00:32:25 +00:00
Joseph Myers bfff8b1bec Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
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
Joseph Myers f7a9f785e5 Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
H.J. Lu 7635a88d32 Add __CPU_MASK_TYPE for __cpu_mask
Since x86-64 and x32 use the same set of sched_XXX system call interface:

[hjl@gnu-6 linux-stable]$ grep sched_
arch/x86/entry/syscalls/syscall_64.tbl
24	common	sched_yield		sys_sched_yield
142	common	sched_setparam		sys_sched_setparam
143	common	sched_getparam		sys_sched_getparam
144	common	sched_setscheduler	sys_sched_setscheduler
145	common	sched_getscheduler	sys_sched_getscheduler
146	common	sched_get_priority_max	sys_sched_get_priority_max
147	common	sched_get_priority_min	sys_sched_get_priority_min
148	common	sched_rr_get_interval	sys_sched_rr_get_interval
203	common	sched_setaffinity	sys_sched_setaffinity
204	common	sched_getaffinity	sys_sched_getaffinity
314	common	sched_setattr		sys_sched_setattr
315	common	sched_getattr		sys_sched_getattr
[hjl@gnu-6 linux-stable]$

__cpu_mask should be unsigned long long, instead of unsigned long, for
x32.  This patch adds __CPU_MASK_TYPE so that each architecture can
define the proper type for __cpu_mask.

	[BZ #19313]
	* bits/typesizes.h (__CPU_MASK_TYPE): New.
	* sysdeps/mach/hurd/bits/typesizes.h (__CPU_MASK_TYPE): Likewise.
	* sysdeps/nacl/bits/typesizes.h (__CPU_MASK_TYPE): Likewise.
	* sysdeps/unix/sysv/linux/alpha/bits/typesizes.h (__CPU_MASK_TYPE):
	Likewise.
	* sysdeps/unix/sysv/linux/generic/bits/typesizes.h (__CPU_MASK_TYPE):
	Likewise.
	* sysdeps/unix/sysv/linux/s390/bits/typesizes.h (__CPU_MASK_TYPE):
	Likewise.
	* sysdeps/unix/sysv/linux/sparc/bits/typesizes.h (__CPU_MASK_TYPE):
	Likewise.
	* sysdeps/unix/sysv/linux/x86/bits/typesizes.h (__CPU_MASK_TYPE):
	* sysdeps/unix/sysv/linux/bits/sched.h (__cpu_mask): Replace
	unsigned long int with __CPU_MASK_TYPE.
2015-12-01 10:25:44 -08:00
Joseph Myers b168057aaa Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
Allan McRae d4697bc93d Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
Joseph Myers 568035b787 Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
Roland McGrath 51367701af Get rid of unused __swblk_t type. 2012-10-01 14:39:29 -07:00
Roland McGrath 8e49df1d65 Clean up {alphasort,versionsort,scandir,scandirat}{,64} for struct dirent == struct dirent64. 2012-08-06 16:48:36 -07:00
Roland McGrath 03af952060 Clean up lockf64, fseeko64, ftello64, fgetpos64, fsetpos64 for off64_t == off_t. 2012-08-06 16:48:14 -07:00
H.J. Lu 3e5aef87d7 Add __fsword_t and use it in bits/statfs.h 2012-05-17 17:20:52 -07:00
H.J. Lu 48970aba30 Fold copyright years 2012-05-16 20:02:44 -07:00
H.J. Lu a46f2169d3 Remove __snseconds_t 2012-05-15 18:05:26 -07:00
H.J. Lu de986b5636 Add __syscall_slong_t and __syscall_ulong_t 2012-05-15 17:41:38 -07:00
H.J. Lu 4be2b57003 Add __snseconds_t and __SNSECONDS_T_TYPE 2012-04-11 11:02:59 -07:00
Paul Eggert 59ba27a63a Replace FSF snail mail address with URLs. 2012-02-09 23:18:22 +00:00
Ulrich Drepper 973d66e453 Update.
* sysdeps/generic/bits/types.h (__ssize_t): Use __SSIZE_T_TYPE
	instead of __SWORD_TYPE.
	* sysdeps/generic/bits/typesizes.h (__SSIZE_T_TYPE): Define.
	* sysdeps/mach/hurd/bits/typesizes.h (__SSIZE_T_TYPE): Define.
	* sysdeps/unix/bsd/bsd4.4/freebsd/bits/typesizes.h (__SSIZE_T_TYPE):
	Define.
	* sysdeps/unix/sysv/linux/alpha/bits/typesizes.h (__SSIZE_T_TYPE):
	Define.
	* sysdeps/unix/sysv/linux/sparc/bits/typesizes.h (__SSIZE_T_TYPE):
	Define.
	* sysdeps/unix/sysv/linux/s390/bits/typesizes.h: New file.
2003-07-31 19:34:52 +00:00
Ulrich Drepper 09402f5bc1 Update.
2003-03-25  Ulrich Drepper  <drepper@redhat.com>

	* csu/tst-atomic.c: Adjust tests to what atomic_add_negative and
	atomic_add_zero were supposed to do.
	* include/atomic.h: Adjust atomic_add_negative and atomic_add_zero
	to x86 behavior.

	* sysdeps/generic/bits/typesizes.h (__TIMER_T_TYPE): Define as void*.
	This matches the new timer implementation.
	* sysdeps/unix/sysv/linux/bits/siginfo.h (struct siginfo): Adjust
	timer info for what the kernel provides these days.
	(struct sigevent): Add _tid field.
	Define SIGEV_THREAD_ID.

	* Versions.def (librt): Add GLIBC_2.3.3.

	* abilist/libpthread.abilist: Update for nptl.
2003-03-25 20:41:26 +00:00
Roland McGrath 3efdabe762 * libio/ftello.c (ftello): Use _IO_off64_t for type of POS.
Check for the result overflowing off_t and fail with EOVERFLOW.
	* libio/ioftell.c (_IO_ftell): Likewise.
	* libio/iofgetpos.c (_IO_new_fgetpos): Likewise.

	* login/logwtmp.c (logwtmp): If sizeof ut_tv != sizeof struct timeval,
	use a temporary timeval on the stack for gettimeofday and copy it.
	* login/logout.c (logout): Likewise.
	Reported by Steven Munroe <sjmunroe@us.ibm.com>.

	* sysdeps/unix/sysv/linux/bits/statfs.h (struct statfs):
	Use __SWORD_TYPE instead of int for member types.
	(struct statfs64): Likewise.
	* sysdeps/unix/sysv/linux/alpha/bits/statfs.h: New file.
	* sysdeps/unix/sysv/linux/s390/bits/statfs.h: New file.
	* sysdeps/unix/sysv/linux/ia64/bits/statfs.h: File removed.
	* sysdeps/unix/sysv/linux/sparc/bits/statfs.h: File removed.
	* sysdeps/unix/sysv/linux/x86_64/bits/statfs.h: File removed.

	* sysdeps/unix/sysv/linux/sparc/bits/statvfs.h: Moved to ...
	* sysdeps/unix/sysv/linux/bits/statvfs.h: ... here.
	(ST_NODIRATIME): Restore fixed value of 2048.
	* sysdeps/unix/sysv/linux/alpha/bits/statvfs.h: File removed.
	* sysdeps/unix/sysv/linux/ia64/bits/statvfs.h: File removed.

	Rearranged <bits/types.h> definitions to reduce duplication.
	* sysdeps/generic/bits/types.h: Rewritten, using macros from
	<bits/wordsize.h> and new header <bits/typesizes.h>.
	* posix/Makefile (headers): Add bits/typesizes.h here.
	* sysdeps/generic/bits/typesizes.h: New file.
	* sysdeps/unix/sysv/linux/alpha/bits/typesizes.h: New file.
	* sysdeps/unix/sysv/linux/sparc/bits/typesizes.h: New file.
	* sysdeps/mach/hurd/bits/typesizes.h: New file.
	* sysdeps/unix/sysv/linux/alpha/bits/types.h: File removed.
	* sysdeps/unix/sysv/linux/bits/types.h: File removed.
	* sysdeps/unix/sysv/linux/ia64/bits/types.h: File removed.
	* sysdeps/unix/sysv/linux/mips/bits/types.h: File removed.
	* sysdeps/unix/sysv/linux/s390/bits/types.h: File removed.
	* sysdeps/unix/sysv/linux/sparc/bits/types.h: File removed.
	* sysdeps/unix/sysv/linux/x86_64/bits/types.h: File removed.
	* posix/sys/types.h [__USE_POSIX199506 || __USE_UNIX98]: Include
	<bits/pthreadtypes.h> here, not in <bits/types.h>.
	* signal/signal.h: Likewise.

	* streams/stropts.h: Include <bits/xtitypes.h>.
	* streams/Makefile (headers): Add bits/xtitypes.h here.
	* sysdeps/generic/bits/xtitypes.h: New file.
	* sysdeps/s390/bits/xtitypes.h: New file.
	* sysdeps/ia64/bits/xtitypes.h: New file.
	* sysdeps/x86_64/bits/xtitypes.h: New file.

	* sysvipc/Makefile (headers): Add bits/ipctypes.h here.
	* sysdeps/generic/bits/ipctypes.h: New file.
	* sysdeps/mips/bits/ipctypes.h: New file.
	* sysdeps/gnu/bits/shm.h: Include <bits/ipctypes.h>.
	* sysdeps/gnu/bits/msq.h: Likewise.
	* sysvipc/sys/ipc.h: Likewise.

2002-10-22  Roland McGrath  <roland@redhat.com>

	* sysdeps/generic/libc-tls.c (_dl_tls_static_used): New variable.
	* sysdeps/generic/ldsodefs.h (struct rtld_global): New member
	`_dl_tls_static_used'.
	(TLS_STATIC_MIN): New macro.
	* elf/dl-reloc.c [USE_TLS] (allocate_static_tls): New function.
	(CHECK_STATIC_TLS): Use it.
2002-10-23 23:50:19 +00:00