glibc/sysdeps
Adhemerval Zanella d4d8a12960 Consolidate Linux truncate implementations
This patch consolidates all Linux truncate implementation on
sysdeps/unix/sysv/linux/truncate{64}.c.  It is based on
{INTERNAL,INLINE}_SYSCALL patch [1] to simplify the syscall
construction.

General idea is to build ftruncate iff __OFF_T_MATCHES_OFF64_T is not
defined, otherwise ftruncate64 will be build and ftruncate will be an
alias.  The fallocate will use old compat syscall and pass 32-bit off_t
argument, while fallocate64 will handle the correct off64_t passing using
__ALIGNMENT_ARG and SYSCALL_LL64 macros.

Tested on x86_64, i386, aarch64, and armhf.

	* sysdeps/unix/sysv/linux/arm/truncate64.c: Remove file.
	* sysdeps/unix/sysv/linux/generic/wordsize-32/truncate.c: Likewise.
	* sysdeps/sysv/linux/generic/wordsize-32/truncate64.c: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips32/truncate64.c: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips64/truncate64.c: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/truncate64.c: Likewise.
	* sysdeps/unix/sysv/linux/wordsize-64/truncate64.c: Likewise.
	* sysdeps/unix/sysv/linux/truncate.c: New file.
	* sysdeps/unix/sysv/linux/truncate64.c (truncate64): Use
	INLINE_SYSCALL_CALL, __ALIGNMENT_ARG and SYSCALL_LL64 macros.
	* sysdeps/unix/sysv/linux/mips/mips64/syscalls.list (truncate):
	Remove.
	* sysdeps/unix/sysv/linux/wordsize-64/syscalls.list (truncate):
	Likewise.

[1] https://sourceware.org/ml/libc-alpha/2016-08/msg00646.html
2016-11-09 17:46:17 -02:00
..
aarch64 nptl: Document the reason why __kind in pthread_mutex_t is part of the ABI 2016-11-07 20:24:32 +01:00
alpha Fix alpha sqrt fegetenv namespace (bug 20768). 2016-11-04 17:19:13 +00:00
arm nptl: Document the reason why __kind in pthread_mutex_t is part of the ABI 2016-11-07 20:24:32 +01:00
generic Do not hardcode platform names in manual/libm-err-tab.pl (bug 14139). 2016-11-04 16:49:06 +00:00
gnu Define wordsize.h macros everywhere 2016-11-04 09:37:44 -07:00
hppa nptl: Document the reason why __kind in pthread_mutex_t is part of the ABI 2016-11-07 20:24:32 +01:00
i386 Do not hardcode platform names in manual/libm-err-tab.pl (bug 14139). 2016-11-04 16:49:06 +00:00
ia64 nptl: Document the reason why __kind in pthread_mutex_t is part of the ABI 2016-11-07 20:24:32 +01:00
ieee754 Add canonicalize, canonicalizef, canonicalizel. 2016-10-26 23:14:31 +00:00
init_array Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
m68k nptl: Document the reason why __kind in pthread_mutex_t is part of the ABI 2016-11-07 20:24:32 +01:00
mach hurd: Fix spurious port deallocation 2016-10-31 17:32:25 +01:00
microblaze nptl: Document the reason why __kind in pthread_mutex_t is part of the ABI 2016-11-07 20:24:32 +01:00
mips nptl: Document the reason why __kind in pthread_mutex_t is part of the ABI 2016-11-07 20:24:32 +01:00
nacl Add canonicalize, canonicalizef, canonicalizel. 2016-10-26 23:14:31 +00:00
nios2 nptl: Document the reason why __kind in pthread_mutex_t is part of the ABI 2016-11-07 20:24:32 +01:00
nptl Installed-header hygiene (BZ#20366): time.h types. 2016-09-23 08:43:56 -04:00
posix hurd: fix fcntl visibility 2016-09-18 23:48:55 +02:00
powerpc Do not hardcode platform names in manual/libm-err-tab.pl (bug 14139). 2016-11-04 16:49:06 +00:00
pthread Installed-header hygiene (BZ#20366): time.h types. 2016-09-23 08:43:56 -04:00
s390 nptl: Document the reason why __kind in pthread_mutex_t is part of the ABI 2016-11-07 20:24:32 +01:00
sh nptl: Document the reason why __kind in pthread_mutex_t is part of the ABI 2016-11-07 20:24:32 +01:00
sparc nptl: Document the reason why __kind in pthread_mutex_t is part of the ABI 2016-11-07 20:24:32 +01:00
tile nptl: Document the reason why __kind in pthread_mutex_t is part of the ABI 2016-11-07 20:24:32 +01:00
unix Consolidate Linux truncate implementations 2016-11-09 17:46:17 -02:00
wordsize-32 Define wordsize.h macros everywhere 2016-11-04 09:37:44 -07:00
wordsize-64 Define wordsize.h macros everywhere 2016-11-04 09:37:44 -07:00
x86 nptl: Document the reason why __kind in pthread_mutex_t is part of the ABI 2016-11-07 20:24:32 +01:00
x86_64 Do not hardcode platform names in manual/libm-err-tab.pl (bug 14139). 2016-11-04 16:49:06 +00:00