fstatat64.c 711 B

123456789101112131415161718192021222324252627282930313233343536
  1. /*
  2. * fstatat64() for uClibc
  3. *
  4. * Copyright (C) 2009 Analog Devices Inc.
  5. *
  6. * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
  7. */
  8. #include <sys/syscall.h>
  9. #include <sys/stat.h>
  10. #include "xstatconv.h"
  11. #ifdef __UCLIBC_HAS_LFS__
  12. /* 64bit ports tend to favor newfstatat() */
  13. #ifdef __NR_newfstatat
  14. # define __NR_fstatat64 __NR_newfstatat
  15. #endif
  16. #ifdef __NR_fstatat64
  17. int fstatat64(int fd, const char *file, struct stat64 *buf, int flag)
  18. {
  19. int ret;
  20. struct kernel_stat64 kbuf;
  21. ret = INLINE_SYSCALL(fstatat64, 4, fd, file, &kbuf, flag);
  22. if (ret == 0)
  23. __xstat64_conv(&kbuf, buf);
  24. return ret;
  25. }
  26. #else
  27. /* should add emulation with fstat64() and /proc/self/fd/ ... */
  28. #endif
  29. #endif