summaryrefslogtreecommitdiff
path: root/emulators/wine/patches/patch-ak
blob: 19712f52e8ae67e9626509e54586c3b9735bcc19 (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.9 2006/11/25 13:23:14 adam Exp $

--- dlls/ntdll/file.c.orig	2006-11-24 17:18:04.000000000 +0100
+++ dlls/ntdll/file.c
@@ -1765,6 +1765,35 @@ static NTSTATUS get_device_info( int fd,
             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;