fstat64.c 803 B

12345678910111213141516171819202122232425262728293031323334353637
  1. /* vi: set sw=4 ts=4: */
  2. /*
  3. * fstat64() for uClibc
  4. *
  5. * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
  6. *
  7. * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
  8. */
  9. #include <_lfs_64.h>
  10. #include <sys/syscall.h>
  11. #ifdef __NR_fstat64
  12. # include <unistd.h>
  13. # include <sys/stat.h>
  14. # include "xstatconv.h"
  15. # define __NR___syscall_fstat64 __NR_fstat64
  16. static __always_inline _syscall2(int, __syscall_fstat64,
  17. int, filedes, struct kernel_stat64 *, buf)
  18. int fstat64(int fd, struct stat64 *buf)
  19. {
  20. #ifdef __ARCH_HAS_DEPRECATED_SYSCALLS__
  21. int result;
  22. struct kernel_stat64 kbuf;
  23. result = __syscall_fstat64(fd, &kbuf);
  24. if (result == 0) {
  25. __xstat64_conv(&kbuf, buf);
  26. }
  27. return result;
  28. #else
  29. return __syscall_fstat64(fd, buf);
  30. #endif
  31. }
  32. libc_hidden_def(fstat64)
  33. #endif