Support for z/OS.

Support is behind sqlite3_flock build tag, and tested through s390x Linux. See #86.
This commit is contained in:
Nuno Cruces
2024-05-04 09:48:50 +01:00
parent 10c494031c
commit 5d5c302ff4
6 changed files with 13 additions and 6 deletions

View File

@@ -145,3 +145,6 @@ jobs:
- name: Test riscv64
run: GOARCH=riscv64 go test -v -short ./...
- name: Test s390x (like z/OS)
run: GOARCH=s390x go test -v -short -tags sqlite3_flock ./...

View File

@@ -31,6 +31,10 @@ However, concurrency is reduced with BSD locks
On Windows, this module uses `LockFileEx` and `UnlockFileEx`,
like SQLite.
On Linux and z/OS, BSD locks are fully functional,
but incompatible with POSIX advisory locks (and SQLite).
You can opt into BSD locks with the `sqlite3_flock` build tag.
On all other platforms, file locking is not supported, and you must use
[`nolock=1`](https://sqlite.org/uri.html#urinolock)
(or [`immutable=1`](https://sqlite.org/uri.html#uriimmutable))

View File

@@ -105,7 +105,7 @@ func Test_vfsLock(t *testing.T) {
t.Fatal("returned", rc)
}
if got := util.ReadUint32(mod, pOutput); got == 0 {
t.Error("file wasn't locked")
t.Log("file wasn't locked, locking is incompatible with SQLite")
}
rc = vfsCheckReservedLock(ctx, mod, pFile2, pOutput)
if rc != _OK {
@@ -132,7 +132,7 @@ func Test_vfsLock(t *testing.T) {
t.Fatal("returned", rc)
}
if got := util.ReadUint32(mod, pOutput); got == 0 {
t.Error("file wasn't locked")
t.Log("file wasn't locked, locking is incompatible with SQLite")
}
rc = vfsCheckReservedLock(ctx, mod, pFile2, pOutput)
if rc != _OK {
@@ -159,7 +159,7 @@ func Test_vfsLock(t *testing.T) {
t.Fatal("returned", rc)
}
if got := util.ReadUint32(mod, pOutput); got == 0 {
t.Error("file wasn't locked")
t.Log("file wasn't locked, locking is incompatible with SQLite")
}
rc = vfsCheckReservedLock(ctx, mod, pFile2, pOutput)
if rc != _OK {

View File

@@ -1,4 +1,4 @@
//go:build !sqlite3_flock && !sqlite3_nosys
//go:build !(sqlite3_flock || sqlite3_nosys)
package vfs

View File

@@ -1,4 +1,4 @@
//go:build !sqlite3_nosys
//go:build !(sqlite3_flock || sqlite3_nosys)
package vfs

View File

@@ -1,4 +1,4 @@
//go:build unix && !sqlite3_flock && !sqlite3_nosys
//go:build unix && !(sqlite3_flock || sqlite3_nosys)
package vfs