1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-30 22:43:12 +03:00

Fix LO_HI_LONG definition

The p{read,write}v{64} consolidation patch [1] added a wrong guard
for LO_HI_LONG definition.  It currently uses both
'__WORDSIZE == 64' and 'defined __ASSUME_WORDSIZE64_ILP32' to set
the value to be passed in one argument, otherwise it will be split
in two.

However it fails on MIPS64n32 where syscalls n32 uses the compat
implementation in the kernel meaning the off_t arguments are passed
in two separate registers.

GLIBC already defines a macro for such cases (__OFF_T_MATCHES_OFF64_T),
so this patch uses it instead.

Checked on x86_64, i686, x32, aarch64, armhf, and s390.

	* sysdeps/unix/sysv/linux/sysdep.h
	[__WORDSIZE == 64 || __ASSUME_WORDSIZE64_ILP32] (LO_HI_LONG): Remove
	guards.
	* misc/tst-preadvwritev-common.c: New file.
	* misc/tst-preadvwritev.c: Use tst-preadvwritev-common.c.
	* misc/tst-preadvwritev64.c: Use tst-preadwritev-common.c and add
	a check for files larger than 2GB.

[1] 4751bbe2ad
This commit is contained in:
Adhemerval Zanella
2016-07-04 11:34:35 -03:00
parent 6320de9536
commit 468700675f
5 changed files with 157 additions and 102 deletions

View File

@ -49,10 +49,6 @@
#endif
/* Provide a macro to pass the off{64}_t argument on p{readv,writev}{64}. */
#if __WORDSIZE == 64 || defined __ASSUME_WORDSIZE64_ILP32
# define LO_HI_LONG(val) (val)
#else
# define LO_HI_LONG(val) \
(long) (val), \
(long) (((uint64_t) (val)) >> 32)
#endif
#define LO_HI_LONG(val) \
(long) (val), \
(long) (((uint64_t) (val)) >> 32)