You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

58 lines
2.0 KiB

  1. Adapted from Debian: https://sources.debian.org/patches/sqlite3/3.32.3-1/20-hurd-locking-style.patch
  2. Upstream status: Not upstreamed.
  3. This patch is needed to get offloading to work.
  4. Sqlite can use simple file locking mode, but that does not work for the Hurd;
  5. a second sqlite process fails with a "locking protocol" error.
  6. See also: https://bugs.debian.org/529734.
  7. diff -purN sqlite-autoconf-3310100/sqlite3.c sqlite-autoconf-3310100-/sqlite3.c
  8. --- sqlite-autoconf-3310100/sqlite3.c 2020-01-27 21:25:19.000000000 +0100
  9. +++ sqlite-autoconf-3310100-/sqlite3.c 2020-07-01 11:50:13.768333806 +0200
  10. @@ -33189,7 +33189,7 @@ SQLITE_PRIVATE const char *sqlite3Opcode
  11. # include <sys/mman.h>
  12. #endif
  13. -#if SQLITE_ENABLE_LOCKING_STYLE
  14. +#if SQLITE_ENABLE_LOCKING_STYLE || defined(__GNU__)
  15. /* # include <sys/ioctl.h> */
  16. # include <sys/file.h>
  17. # include <sys/param.h>
  18. @@ -35676,7 +35676,7 @@ static int dotlockClose(sqlite3_file *id
  19. **
  20. ** Omit this section if SQLITE_ENABLE_LOCKING_STYLE is turned off
  21. */
  22. -#if SQLITE_ENABLE_LOCKING_STYLE
  23. +#if SQLITE_ENABLE_LOCKING_STYLE || defined(__GNU__)
  24. /*
  25. ** Retry flock() calls that fail with EINTR
  26. @@ -38586,7 +38586,7 @@ IOMETHODS(
  27. 0 /* xShmMap method */
  28. )
  29. -#if SQLITE_ENABLE_LOCKING_STYLE
  30. +#if SQLITE_ENABLE_LOCKING_STYLE || defined(__GNU__)
  31. IOMETHODS(
  32. flockIoFinder, /* Finder function name */
  33. flockIoMethods, /* sqlite3_io_methods object name */
  34. @@ -41142,6 +41142,8 @@ SQLITE_API int sqlite3_os_init(void){
  35. UNIXVFS("unix", autolockIoFinder ),
  36. #elif OS_VXWORKS
  37. UNIXVFS("unix", vxworksIoFinder ),
  38. +#elif defined(__GNU__)
  39. + UNIXVFS("unix", flockIoFinder ),
  40. #else
  41. UNIXVFS("unix", posixIoFinder ),
  42. #endif
  43. @@ -41151,7 +41153,7 @@ SQLITE_API int sqlite3_os_init(void){
  44. #if OS_VXWORKS
  45. UNIXVFS("unix-namedsem", semIoFinder ),
  46. #endif
  47. -#if SQLITE_ENABLE_LOCKING_STYLE || OS_VXWORKS
  48. +#if SQLITE_ENABLE_LOCKING_STYLE || OS_VXWORKS || defined(__GNU__)
  49. UNIXVFS("unix-posix", posixIoFinder ),
  50. #endif
  51. #if SQLITE_ENABLE_LOCKING_STYLE