[PATCH] NetBSD: handle statvfs filesystem returns.
Marcus Meissner
marcus at jet.franken.de
Sun Oct 22 14:50:53 CDT 2006
---
dlls/ntdll/file.c | 29 +++++++++++++++++++++++++++++
1 files changed, 29 insertions(+), 0 deletions(-)
eb44f7accfeb92b586ee29a3cddee81648642d49
diff --git a/dlls/ntdll/file.c b/dlls/ntdll/file.c
index 0d189d1..c4523f7 100644
--- a/dlls/ntdll/file.c
+++ b/dlls/ntdll/file.c
@@ -1624,6 +1624,35 @@ NTSTATUS FILE_GetDeviceInfo( int fd, FIL
info->DeviceType = FILE_DEVICE_DISK_FILE_SYSTEM;
break;
}
+#elif defined(__NetBSD__)
+ struct statvfs stfs;
+
+ if (fstatvfs( fd, &stfs) < 0)
+ info->DeviceType = FILE_DEVICE_DISK_FILE_SYSTEM;
+ else if (!strncmp("cd9660", stfs.f_fstypename,
+ sizeof(stfs.f_fstypename)))
+ {
+ info->DeviceType = FILE_DEVICE_CD_ROM_FILE_SYSTEM;
+ info->Characteristics |= FILE_REMOVABLE_MEDIA;
+ }
+ else if (!strncmp("nfs", stfs.f_fstypename,
+ sizeof(stfs.f_fstypename)))
+ {
+ info->DeviceType = FILE_DEVICE_NETWORK_FILE_SYSTEM;
+ info->Characteristics |= FILE_REMOTE_DEVICE;
+ }
+ else if (!strncmp("procfs", stfs.f_fstypename,
+ sizeof(stfs.f_fstypename)))
+ info->DeviceType = FILE_DEVICE_VIRTUAL_DISK;
+ else
+ info->DeviceType = FILE_DEVICE_DISK_FILE_SYSTEM;
+ if (stfs.f_flag & MNT_RDONLY)
+ info->Characteristics |= FILE_READ_ONLY_DEVICE;
+ if (!(stfs.f_flag & MNT_LOCAL))
+ {
+ info->DeviceType = FILE_DEVICE_NETWORK_FILE_SYSTEM;
+ info->Characteristics |= FILE_REMOTE_DEVICE;
+ }
#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__APPLE__)
struct statfs stfs;
--
1.2.4
More information about the wine-patches
mailing list