$OpenBSD: patch-base_process_process_posix_cc,v 1.2 2015/07/23 13:44:04 robert Exp $
--- base/process/process_posix.cc.orig.port	Wed Jul 15 22:29:55 2015
+++ base/process/process_posix.cc	Wed Jul 22 16:22:41 2015
@@ -16,9 +16,13 @@
 #if defined(OS_MACOSX)
 #include <sys/event.h>
 #endif
+#include <signal.h>
 
 namespace {
 
+const int kBackgroundPriority = 5;
+const int kForegroundPriority = 0;
+
 #if !defined(OS_NACL_NONSFI)
 
 bool WaitpidWithTimeout(base::ProcessHandle handle,
@@ -253,13 +257,6 @@ Process Process::DeprecatedGetProcessFromHandle(Proces
   return Process(handle);
 }
 
-#if !defined(OS_LINUX) && !defined(OS_MACOSX)
-// static
-bool Process::CanBackgroundProcesses() {
-  return false;
-}
-#endif  // !defined(OS_LINUX) && !defined(OS_MACOSX)
-
 bool Process::IsValid() const {
   return process_ != kNullProcessHandle;
 }
@@ -353,21 +350,26 @@ bool Process::WaitForExitWithTimeout(TimeDelta timeout
   return WaitForExitWithTimeoutImpl(Handle(), exit_code, timeout);
 }
 
-#if !defined(OS_LINUX) && !defined(OS_MACOSX)
+bool Process::CanBackgroundProcesses() {
+    return true;
+}
+
 bool Process::IsProcessBackgrounded() const {
-  // See SetProcessBackgrounded().
   DCHECK(IsValid());
-  return false;
+  return GetPriority() == kBackgroundPriority;
 }
 
-bool Process::SetProcessBackgrounded(bool value) {
-  // Not implemented for POSIX systems other than Mac and Linux. With POSIX, if
-  // we were to lower the process priority we wouldn't be able to raise it back
-  // to its initial priority.
-  NOTIMPLEMENTED();
-  return false;
+bool Process::SetProcessBackgrounded(bool background) {
+  DCHECK(IsValid());
+
+  if (!CanBackgroundProcesses())
+    return false;
+
+  int priority = background ? kBackgroundPriority : kForegroundPriority;
+  int result = setpriority(PRIO_PROCESS, process_, priority);
+  DPCHECK(result == 0);
+  return result == 0;
 }
-#endif  // !defined(OS_LINUX) && !defined(OS_MACOSX)
 
 int Process::GetPriority() const {
   DCHECK(IsValid());
