Description: Added locking information for GNU Hurd
Forwarded: https://github.com/sqlcipher/sqlcipher/pull/493
Last-Update: 2023-11-09
--
Index: sqlcipher/src/os_unix.c
===================================================================
--- sqlcipher.orig/src/os_unix.c	2023-11-09 11:08:37.077305273 +0100
+++ sqlcipher/src/os_unix.c	2023-11-09 11:08:37.069305252 +0100
@@ -100,7 +100,7 @@
 # include <sys/mman.h>
 #endif
 
-#if SQLITE_ENABLE_LOCKING_STYLE
+#if SQLITE_ENABLE_LOCKING_STYLE || defined(__GNU__)
 # include <sys/ioctl.h>
 # include <sys/file.h>
 # include <sys/param.h>
@@ -2441,7 +2441,7 @@
 **
 ** Omit this section if SQLITE_ENABLE_LOCKING_STYLE is turned off
 */
-#if SQLITE_ENABLE_LOCKING_STYLE
+#if SQLITE_ENABLE_LOCKING_STYLE || defined(__GNU__)
 
 /*
 ** Retry flock() calls that fail with EINTR
@@ -5476,7 +5476,7 @@
   0                         /* xShmMap method */
 )
 
-#if SQLITE_ENABLE_LOCKING_STYLE
+#if SQLITE_ENABLE_LOCKING_STYLE || defined(__GNU__)
 IOMETHODS(
   flockIoFinder,            /* Finder function name */
   flockIoMethods,           /* sqlite3_io_methods object name */
@@ -8068,6 +8068,8 @@
     UNIXVFS("unix",          autolockIoFinder ),
 #elif OS_VXWORKS
     UNIXVFS("unix",          vxworksIoFinder ),
+#elif defined(__GNU__)
+    UNIXVFS("unix",          flockIoFinder ),
 #else
     UNIXVFS("unix",          posixIoFinder ),
 #endif
@@ -8077,7 +8079,7 @@
 #if OS_VXWORKS
     UNIXVFS("unix-namedsem", semIoFinder ),
 #endif
-#if SQLITE_ENABLE_LOCKING_STYLE || OS_VXWORKS
+#if SQLITE_ENABLE_LOCKING_STYLE || OS_VXWORKS || defined(__GNU__)
     UNIXVFS("unix-posix",    posixIoFinder ),
 #endif
 #if SQLITE_ENABLE_LOCKING_STYLE
