summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/common/ftruncate64.c
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2013-04-01 05:09:17 -0400
committerMike Frysinger <vapier@gentoo.org>2013-04-01 05:58:02 -0400
commit6f3f843335004fa71719a474f2a7c4916bd949dc (patch)
treef69e5917b3af0b41f91905586a09a2c479115b59 /libc/sysdeps/linux/common/ftruncate64.c
parent9f9d2dea175bc0ea884bd4815acf2004b859c2b5 (diff)
linux: use OFF64_HI_LO rather than __LONG_LONG_PAIR
This macro takes care of the shift/mask split for us, so no need to open code this ourselves and then use __LONG_LONG_PAIR. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'libc/sysdeps/linux/common/ftruncate64.c')
-rw-r--r--libc/sysdeps/linux/common/ftruncate64.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/libc/sysdeps/linux/common/ftruncate64.c b/libc/sysdeps/linux/common/ftruncate64.c
index c0a373ca1..231d94a33 100644
--- a/libc/sysdeps/linux/common/ftruncate64.c
+++ b/libc/sysdeps/linux/common/ftruncate64.c
@@ -7,7 +7,7 @@
* and on 32 bit machines this sends things into the kernel as
* two 32-bit arguments (high and low 32 bits of length) that
* are ordered based on endianess. It turns out endian.h has
- * just the macro we need to order things, __LONG_LONG_PAIR.
+ * just the macro we need to order things, OFF64_HI_LO.
*/
#include <_lfs_64.h>
@@ -29,14 +29,10 @@ _syscall2(int, ftruncate64, int, fd, __off64_t, length)
/* The exported ftruncate64 function. */
int ftruncate64 (int fd, __off64_t length)
{
- uint32_t low = length & 0xffffffff;
- uint32_t high = length >> 32;
# if defined(__UCLIBC_SYSCALL_ALIGN_64BIT__)
- return INLINE_SYSCALL(ftruncate64,
- 4, fd, 0, __LONG_LONG_PAIR (high, low));
+ return INLINE_SYSCALL(ftruncate64, 4, fd, 0, OFF64_HI_LO(length));
# else
- return INLINE_SYSCALL(ftruncate64, 3, fd,
- __LONG_LONG_PAIR (high, low));
+ return INLINE_SYSCALL(ftruncate64, 3, fd, OFF64_HI_LO(length));
# endif
}