statfs.h: sync generic header with glibc
[uclibc-ng.git] / libc / sysdeps / linux / common / fstatfs.c
blob0b2709ce37a53cd3b0c185b709e1eb9be6eb3c16
1 /*
2 * fstatfs() for uClibc
4 * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
6 * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
7 */
9 #include <sys/syscall.h>
10 #include <sys/vfs.h>
11 #include <string.h>
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
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)
32 int err = INLINE_SYSCALL(fstatfs64, 3, __fildes, sizeof(*__buf), __buf);
33 return err;
35 /* Redefined fstatfs because we need it for backwards compatibility */
36 #endif /* __NR_fstatfs */
38 #if defined __UCLIBC_LINUX_SPECIFIC__
39 weak_alias(__libc_fstatfs,fstatfs)
40 #endif