~cypheon/pkgsrc-wip

pkgsrc-wip/miktex/patches/patch-Libraries_MiKTeX_Core_Process_unx_unxProcess.cpp -rw-r--r-- 1.3 KiB
5f1bf4f5 — Johann Rudloff Subst PLIST paths for platform specific files for other architectures 7 months ago
                                                                                
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
41
42
43
44
$NetBSD$

Handle NetBSD like FreeBSD.
TODO: Still needs more porting to compile.

--- Libraries/MiKTeX/Core/Process/unx/unxProcess.cpp.orig	2019-11-16 19:20:48.000000000 +0000
+++ Libraries/MiKTeX/Core/Process/unx/unxProcess.cpp
@@ -30,14 +30,16 @@
 #  include <sys/proc.h>
 #endif
 
-#if defined(__FreeBSD__)
+#if defined(__FreeBSD__) || defined(__NetBSD__)
 #   include <sys/param.h>
 #   include <sys/queue.h>
 #   include <sys/socket.h>
 #   include <sys/sysctl.h>
+#if defined(__FreeBSD__)
 #   include <sys/user.h>
-#   include <kvm.h>
 #   include <libprocstat.h>
+#endif
+#   include <kvm.h>
 #   include <fcntl.h>
 #endif
 
@@ -635,7 +637,7 @@ string unxProcess::get_ProcessName()
     MIKTEX_FATAL_CRT_ERROR("proc_pidpath")
   }
   return PathName(path).GetFileName().ToString();
-#elif defined(__FreeBSD__)
+#elif defined(__FreeBSD__) || defined(__NetBSD__)
   std::string nameFromProcstat;
   kvm_t *kvm = kvm_open(nullptr, "/dev/null", nullptr, O_RDONLY, "");
   if (kvm)
@@ -755,7 +757,7 @@ ProcessInfo unxProcess::GetProcessInfo()
       break;
   }
   processInfo.parent = pbi.pbi_ppid;
-#elif defined(__FreeBSD__)
+#elif defined(__FreeBSD__) || defined(__NetBSD__)
   processInfo.parent = getppid();
 
   kvm_t *kvm = kvm_open(nullptr, "/dev/null", nullptr, O_RDONLY, "");