summaryrefslogtreecommitdiff
path: root/sysdeps/unix/sysv/linux/ftruncate64.c
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2018-12-27 18:56:13 +0000
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2018-12-27 18:57:13 +0000
commit82dd75a7f436a19047325d62182590c9f9e23a78 (patch)
tree60ca20c8cf2b0d178d84725c0715471f76df97e1 /sysdeps/unix/sysv/linux/ftruncate64.c
parent0bbb676a2342367c4e52b35e890f24667dabb348 (diff)
parent963c37d5c0eb62b38f8764b23931c0dcdd497a13 (diff)
Merge commit 'refs/top-bases/t/tls' into t/tls
Diffstat (limited to 'sysdeps/unix/sysv/linux/ftruncate64.c')
-rw-r--r--sysdeps/unix/sysv/linux/ftruncate64.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/sysdeps/unix/sysv/linux/ftruncate64.c b/sysdeps/unix/sysv/linux/ftruncate64.c
index a6bf878ddf..eadc7d3438 100644
--- a/sysdeps/unix/sysv/linux/ftruncate64.c
+++ b/sysdeps/unix/sysv/linux/ftruncate64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -15,22 +15,24 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <sys/types.h>
-#include <errno.h>
-#include <endian.h>
#include <unistd.h>
-
#include <sysdep.h>
-#include <sys/syscall.h>
+#include <errno.h>
+
+#ifndef __NR_ftruncate64
+# define __NR_ftruncate64 __NR_ftruncate
+#endif
/* Truncate the file referenced by FD to LENGTH bytes. */
int
__ftruncate64 (int fd, off64_t length)
{
- unsigned int low = length & 0xffffffff;
- unsigned int high = length >> 32;
- int result = INLINE_SYSCALL (ftruncate64, 3, fd,
- __LONG_LONG_PAIR (high, low));
- return result;
+ return INLINE_SYSCALL_CALL (ftruncate64, fd,
+ __ALIGNMENT_ARG SYSCALL_LL64 (length));
}
weak_alias (__ftruncate64, ftruncate64)
+
+#ifdef __OFF_T_MATCHES_OFF64_T
+weak_alias (__ftruncate64, __ftruncate)
+weak_alias (__ftruncate64, ftruncate);
+#endif