fstatfs.c 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /*
  2. * fstatfs() for uClibc
  3. *
  4. * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
  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/vfs.h>
  10. #include <string.h>
  11. #ifndef __USE_FILE_OFFSET64__
  12. extern int fstatfs (int __fildes, struct statfs *__buf)
  13. __THROW __nonnull ((2));
  14. #else
  15. # ifdef __REDIRECT_NTH
  16. extern int __REDIRECT_NTH (fstatfs, (int __fildes, struct statfs *__buf),
  17. fstatfs64) __nonnull ((2));
  18. # else
  19. # define fstatfs fstatfs64
  20. # endif
  21. #endif
  22. extern __typeof(fstatfs) __libc_fstatfs attribute_hidden;
  23. #ifdef __NR_fstatfs
  24. # define __NR___libc_fstatfs __NR_fstatfs
  25. _syscall2(int, __libc_fstatfs, int, fd, struct statfs *, buf)
  26. #else
  27. int __libc_fstatfs (int __fildes, struct statfs *__buf)
  28. {
  29. int err = INLINE_SYSCALL(fstatfs64, 3, __fildes, sizeof(*__buf), __buf);
  30. return err;
  31. };
  32. /* Redefined fstatfs because we need it for backwards compatibility */
  33. #endif /* __NR_fstatfs */
  34. #if defined __UCLIBC_LINUX_SPECIFIC__
  35. weak_alias(__libc_fstatfs,fstatfs)
  36. #endif