20d44b0e9c
and move back to KERN_PROC from KERN_PROC2 now that we can.
50 lines
1.7 KiB
Plaintext
50 lines
1.7 KiB
Plaintext
$OpenBSD: patch-base_process_util_h,v 1.4 2011/03/16 10:52:46 robert Exp $
|
|
--- base/process_util.h.orig Fri Mar 11 10:01:33 2011
|
|
+++ base/process_util.h Wed Mar 16 09:41:54 2011
|
|
@@ -14,14 +14,16 @@
|
|
#if defined(OS_WIN)
|
|
#include <windows.h>
|
|
#include <tlhelp32.h>
|
|
-#elif defined(OS_MACOSX)
|
|
+#elif defined(OS_MACOSX) || defined(OS_OPENBSD)
|
|
// kinfo_proc is defined in <sys/sysctl.h>, but this forward declaration
|
|
// is sufficient for the vector<kinfo_proc> below.
|
|
struct kinfo_proc;
|
|
// malloc_zone_t is defined in <malloc/malloc.h>, but this forward declaration
|
|
// is sufficient for GetPurgeableZone() below.
|
|
typedef struct _malloc_zone_t malloc_zone_t;
|
|
+#if !defined(OS_OPENBSD)
|
|
#include <mach/mach.h>
|
|
+#endif
|
|
#elif defined(OS_POSIX)
|
|
#include <dirent.h>
|
|
#include <limits.h>
|
|
@@ -161,7 +163,7 @@ void CloseProcessHandle(ProcessHandle process);
|
|
// Win XP SP1 as well.
|
|
ProcessId GetProcId(ProcessHandle process);
|
|
|
|
-#if defined(OS_LINUX)
|
|
+#if defined(OS_LINUX) || defined(OS_OPENBSD)
|
|
// Returns the ID for the parent of the given process.
|
|
ProcessId GetParentProcessId(ProcessHandle process);
|
|
|
|
@@ -172,7 +174,8 @@ FilePath GetProcessExecutablePath(ProcessHandle proces
|
|
// CPU-related ticks. Returns -1 on parse error.
|
|
// Exposed for testing.
|
|
int ParseProcStatCPU(const std::string& input);
|
|
-
|
|
+#endif
|
|
+#if defined(OS_LINUX)
|
|
static const char kAdjustOOMScoreSwitch[] = "--adjust-oom-score";
|
|
|
|
// This adjusts /proc/process/oom_adj so the Linux OOM killer will prefer
|
|
@@ -439,7 +442,7 @@ class ProcessIterator {
|
|
#if defined(OS_WIN)
|
|
HANDLE snapshot_;
|
|
bool started_iteration_;
|
|
-#elif defined(OS_MACOSX)
|
|
+#elif defined(OS_MACOSX) || defined(OS_OPENBSD)
|
|
std::vector<kinfo_proc> kinfo_procs_;
|
|
size_t index_of_kinfo_proc_;
|
|
#elif defined(OS_POSIX)
|