blob: d714add90e92960b1b0649e575a81139903d755f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
$NetBSD: patch-ak,v 1.8 2006/10/18 20:37:21 adam Exp $
--- dlls/ntdll/file.c.orig 2006-10-13 16:43:39.000000000 +0200
+++ 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;
|