fstatat64.c 699 B

123456789101112131415161718192021222324252627282930313233
  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 <_lfs_64.h>
  9. #include <sys/syscall.h>
  10. /* 64bit ports tend to favor newfstatat() */
  11. #ifdef __NR_newfstatat
  12. # define __NR_fstatat64 __NR_newfstatat
  13. #endif
  14. #ifdef __NR_fstatat64
  15. # include <sys/stat.h>
  16. # include "xstatconv.h"
  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