ftruncate64.c 1008 B

123456789101112131415161718192021222324252627282930313233
  1. /*
  2. * libc/sysdeps/linux/v850/ftruncate64.c -- `ftruncate64' syscall for linux/v850
  3. *
  4. * Copyright (C) 2002 NEC Corporation
  5. * Copyright (C) 2002 Miles Bader <miles@gnu.org>
  6. *
  7. * This file is subject to the terms and conditions of the GNU Lesser
  8. * General Public License. See the file COPYING.LIB in the main
  9. * directory of this archive for more details.
  10. *
  11. * Written by Miles Bader <miles@gnu.org>
  12. */
  13. #include <features.h>
  14. #include <unistd.h>
  15. #include <errno.h>
  16. #include <sys/syscall.h>
  17. #ifdef __UCLIBC_HAVE_LFS__
  18. /* A version of ftruncate64 that passes in the 64-bit length argument as two
  19. 32-bit arguments, as required by system call interface on the v850. */
  20. #define __NR__ftruncate64 __NR_ftruncate64
  21. extern inline _syscall3 (int, _ftruncate64,
  22. int, fd, unsigned long, len_lo, long, len_hi);
  23. /* The exported ftruncate64. */
  24. int ftruncate64 (int fd, __off64_t length)
  25. {
  26. return _ftruncate64 (fd, (unsigned long)length, (long)(length >> 32));
  27. }
  28. #endif /* __UCLIBC_HAVE_LFS__ */