$OpenBSD: patch-third_party_sqlite_amalgamation_sqlite3_c,v 1.10 2019/09/23 07:18:04 robert Exp $

Index: third_party/sqlite/amalgamation/sqlite3.c
--- third_party/sqlite/amalgamation/sqlite3.c.orig
+++ third_party/sqlite/amalgamation/sqlite3.c
@@ -39003,7 +39003,12 @@ static int unixRandomness(sqlite3_vfs *NotUsed, int nB
   memset(zBuf, 0, nBuf);
   randomnessPid = osGetpid(0);
 #if !defined(SQLITE_TEST) && !defined(SQLITE_OMIT_RANDOMNESS)
+#if defined(__OpenBSD__)
   {
+    arc4random_buf(zBuf, nBuf);
+  }
+#else
+  {
     int fd, got;
     fd = robust_open("/dev/urandom", O_RDONLY, 0);
     if( fd<0 ){
@@ -39018,6 +39023,7 @@ static int unixRandomness(sqlite3_vfs *NotUsed, int nB
       robust_close(0, fd, __LINE__);
     }
   }
+#endif
 #endif
   return nBuf;
 }
