summaryrefslogtreecommitdiff
path: root/emulators/wine/patches/patch-ak
blob: aa6677a2a00356c253f166a09e425617feedd87e (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.10 2007/01/30 13:11:04 adam Exp $

--- dlls/ntdll/file.c.orig	2007-01-25 16:53:50.000000000 +0100
+++ dlls/ntdll/file.c
@@ -1773,6 +1773,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;