From eea9e45879a0aca3ca44a614f3eb1059b1634241 Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Fri, 1 Mar 2002 21:20:49 +0000 Subject: Patch from Miles Bader to allow Large File support on the v850. --- libc/sysdeps/linux/v850/ftruncate64.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 libc/sysdeps/linux/v850/ftruncate64.c (limited to 'libc/sysdeps/linux/v850/ftruncate64.c') diff --git a/libc/sysdeps/linux/v850/ftruncate64.c b/libc/sysdeps/linux/v850/ftruncate64.c new file mode 100644 index 000000000..929332751 --- /dev/null +++ b/libc/sysdeps/linux/v850/ftruncate64.c @@ -0,0 +1,33 @@ +/* + * libc/sysdeps/linux/v850/ftruncate64.c -- `ftruncate64' syscall for linux/v850 + * + * Copyright (C) 2002 NEC Corporation + * Copyright (C) 2002 Miles Bader + * + * This file is subject to the terms and conditions of the GNU Lesser + * General Public License. See the file COPYING.LIB in the main + * directory of this archive for more details. + * + * Written by Miles Bader + */ + +#include +#include +#include +#include + +#ifdef __UCLIBC_HAVE_LFS__ + +/* A version of ftruncate64 that passes in the 64-bit length argument as two + 32-bit arguments, as required by system call interface on the v850. */ +#define __NR__ftruncate64 __NR_ftruncate64 +extern inline _syscall3 (int, _ftruncate64, + int, fd, unsigned long, len_lo, long, len_hi); + +/* The exported ftruncate64. */ +int ftruncate64 (int fd, __off64_t length) +{ + return _ftruncate64 (fd, (unsigned long)length, (long)(length >> 32)); +} + +#endif /* __UCLIBC_HAVE_LFS__ */ -- cgit v1.2.3