$OpenBSD: patch-tools_gn_base_files_file_util_posix_cc,v 1.2 2019/04/17 11:48:55 robert Exp $

Index: tools/gn/base/files/file_util_posix.cc
--- tools/gn/base/files/file_util_posix.cc.orig
+++ tools/gn/base/files/file_util_posix.cc
@@ -112,7 +112,7 @@ std::string TempFileName() {
   return std::string(".org.chromium.Chromium.XXXXXX");
 }
 
-#if defined(OS_LINUX) || defined(OS_AIX)
+#if defined(OS_LINUX) || defined(OS_AIX) || defined(OS_BSD)
 // Determine if /dev/shm files can be mapped and then mprotect'd PROT_EXEC.
 // This depends on the mount options used for /dev/shm, which vary among
 // different Linux distributions and possibly local configuration.  It also
@@ -254,7 +254,7 @@ bool ReplaceFile(const FilePath& from_path,
 #endif  // !defined(OS_NACL_NONSFI)
 
 bool CreateLocalNonBlockingPipe(int fds[2]) {
-#if defined(OS_LINUX)
+#if defined(OS_LINUX) || defined(OS_BSD)
   return pipe2(fds, O_CLOEXEC | O_NONBLOCK) == 0;
 #else
   int raw_fds[2];
@@ -753,7 +753,7 @@ int GetMaximumPathComponentLength(const FilePath& path
 }
 
 bool GetShmemTempDir(bool executable, FilePath* path) {
-#if defined(OS_LINUX) || defined(OS_AIX)
+#if defined(OS_LINUX) || defined(OS_AIX) || defined(OS_BSD)
   bool use_dev_shm = true;
   if (executable) {
     static const bool s_dev_shm_executable = DetermineDevShmExecutable();
