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