fstatat.c 548 B

123456789101112131415161718192021222324252627
  1. /*
  2. * fstatat() 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 __NR_fstatat64
  12. int fstatat(int fd, const char *file, struct stat *buf, int flag)
  13. {
  14. int ret;
  15. struct kernel_stat kbuf;
  16. ret = INLINE_SYSCALL(fstatat64, 4, fd, file, &kbuf, flag);
  17. if (ret == 0)
  18. __xstat_conv(&kbuf, buf);
  19. return ret;
  20. }
  21. #else
  22. /* should add emulation with fstat() and /proc/self/fd/ ... */
  23. #endif