]>
Commit | Line | Data |
---|---|---|
cf2478d5 | 1 | /* Get filesystem statistics (deprecated). Linux version. |
2b778ceb | 2 | Copyright (C) 1997-2021 Free Software Foundation, Inc. |
54d79e99 | 3 | This file is part of the GNU C Library. |
df4ef2ab | 4 | Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997. |
28f540f4 | 5 | |
54d79e99 | 6 | The GNU C Library is free software; you can redistribute it and/or |
41bdb6e2 AJ |
7 | modify it under the terms of the GNU Lesser General Public |
8 | License as published by the Free Software Foundation; either | |
9 | version 2.1 of the License, or (at your option) any later version. | |
28f540f4 | 10 | |
54d79e99 UD |
11 | The GNU C Library is distributed in the hope that it will be useful, |
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
41bdb6e2 | 14 | Lesser General Public License for more details. |
28f540f4 | 15 | |
41bdb6e2 | 16 | You should have received a copy of the GNU Lesser General Public |
59ba27a6 | 17 | License along with the GNU C Library; if not, see |
5a82c748 | 18 | <https://www.gnu.org/licenses/>. */ |
28f540f4 | 19 | |
cf2478d5 | 20 | #include <shlib-compat.h> |
28f540f4 | 21 | |
cf2478d5 AZ |
22 | /* This deprecated syscall is no longer used (replaced with {f}statfs). */ |
23 | #if SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_28) | |
61c162b5 | 24 | |
cf2478d5 | 25 | # include <sysdep.h> |
01bd6251 | 26 | # include <sys/types.h> |
cf2478d5 AZ |
27 | |
28 | # ifndef DEV_TO_KDEV | |
29 | # define DEV_TO_KDEV(__dev) \ | |
30 | ({ \ | |
31 | unsigned long long int k_dev; \ | |
32 | k_dev = dev & ((1ULL << 32) - 1); \ | |
33 | if (k_dev != dev) \ | |
34 | return INLINE_SYSCALL_ERROR_RETURN_VALUE (EINVAL); \ | |
35 | (unsigned int) k_dev; \ | |
36 | }) | |
37 | # endif | |
28f540f4 | 38 | |
cf2478d5 AZ |
39 | struct ustat |
40 | { | |
41 | __daddr_t f_tfree; /* Number of free blocks. */ | |
42 | __ino_t f_tinode; /* Number of free inodes. */ | |
43 | char f_fname[6]; | |
44 | char f_fpack[6]; | |
45 | }; | |
f127cd28 | 46 | |
cf2478d5 AZ |
47 | int |
48 | __old_ustat (dev_t dev, struct ustat *ubuf) | |
49 | { | |
50 | # ifdef __NR_ustat | |
51 | return INLINE_SYSCALL_CALL (ustat, DEV_TO_KDEV (dev), ubuf); | |
52 | # else | |
53 | return INLINE_SYSCALL_ERROR_RETURN_VALUE (ENOSYS); | |
54 | # endif | |
df4ef2ab | 55 | } |
cf2478d5 AZ |
56 | compat_symbol (libc, __old_ustat, ustat, GLIBC_2_0); |
57 | #endif /* SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_28) */ |