truncate64.c 1.0 KB

12345678910111213141516171819202122232425262728293031323334
  1. /*
  2. * libc/sysdeps/linux/v850/truncate64.c -- `truncate64' 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 truncate64 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__truncate64 __NR_truncate64
  21. extern inline _syscall3 (int, _truncate64,
  22. const char *, file,
  23. unsigned long, len_lo, long, len_hi);
  24. /* The exported truncate64. */
  25. int truncate64 (const char *file, __off64_t length)
  26. {
  27. return _truncate64 (file, (unsigned long)length, (long)(length >> 32));
  28. }
  29. #endif /* __UCLIBC_HAVE_LFS__ */