diff --git a/src/system/libroot/os/arch/x86/compatibility.c b/src/system/libroot/os/arch/x86/compatibility.c index 0546faec49..6192917243 100644 --- a/src/system/libroot/os/arch/x86/compatibility.c +++ b/src/system/libroot/os/arch/x86/compatibility.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2006, Axel Dörfler, axeld@pinc-software.de. All rights reserved. + * Copyright 2005-2007, Axel Dörfler, axeld@pinc-software.de. All rights reserved. * Distributed under the terms of the MIT License. */ @@ -12,10 +12,13 @@ // ToDo: maybe they should indeed do something... #include +#include -#include #include + #include +#include +#include int _kset_mon_limit_(int num); @@ -23,6 +26,7 @@ int _kset_fd_limit_(int num); int _klock_node_(int fd); int _kget_cpu_state_(int cpuNum); int _kset_cpu_state_(int cpuNum, int state); +int _kstatfs_(dev_t device, void *whatever, int fd, const char *path, fs_info *info); int @@ -71,4 +75,25 @@ _kset_cpu_state_(int cpuNum, int state) return _kern_set_cpu_enabled(cpuNum, state != 0); } + +int +_kstatfs_(dev_t device, void *whatever, int fd, const char *path, fs_info *info) +{ + if (device < 0) { + if (fd >= 0) { + struct stat stat; + if (fstat(fd, &stat) < 0) + return -1; + + device = stat.st_dev; + } else if (path != NULL) + device = dev_for_path(path); + } + if (device < 0) + return B_ERROR; + + return fs_stat_dev(device, info); +} + + #endif // __GNUC__ < 3