diff --git a/doc.go b/doc.go index c4550af..76b215c 100644 --- a/doc.go +++ b/doc.go @@ -38,10 +38,10 @@ // // Changelog // -// 2022-07-25 v1.18.0: +// 2022-07-26 v1.18.0: // // Adds support for Go fs.FS based SQLite virtual filesystems, see function New -// in modernc.org/sqlite/vfs. +// in modernc.org/sqlite/vfs and/or TestVFS in all_test.go // // 2022-04-24 v1.17.0: // diff --git a/norlimit.go b/norlimit.go index d30388d..52d3139 100644 --- a/norlimit.go +++ b/norlimit.go @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build !freebsd && !ppc64le && !riscv64 -// +build !freebsd,!ppc64le,!riscv64 +//go:build windows +// +build windows package sqlite // import "modernc.org/sqlite" diff --git a/rlimit_freebsd.go b/rlimit.go similarity index 91% rename from rlimit_freebsd.go rename to rlimit.go index c3d4ddb..f5e3551 100644 --- a/rlimit_freebsd.go +++ b/rlimit.go @@ -2,6 +2,9 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build freebsd +// +build freebsd + package sqlite // import "modernc.org/sqlite" import ( diff --git a/rlimit_riscv64.go b/rlimit_riscv64.go deleted file mode 100644 index 754b476..0000000 --- a/rlimit_riscv64.go +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2021 The Sqlite Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package sqlite // import "modernc.org/sqlite" - -import ( - "golang.org/x/sys/unix" -) - -func setMaxOpenFiles(n int64) error { - var rLimit unix.Rlimit - rLimit.Max = uint64(n) - rLimit.Cur = uint64(n) - return unix.Setrlimit(unix.RLIMIT_NOFILE, &rLimit) -} diff --git a/rlimit_ppc64le.go b/rulimit.go similarity index 82% rename from rlimit_ppc64le.go rename to rulimit.go index 754b476..adfd69b 100644 --- a/rlimit_ppc64le.go +++ b/rulimit.go @@ -2,6 +2,9 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build linux || darwin || netbsd || openbsd +// +build linux darwin netbsd openbsd + package sqlite // import "modernc.org/sqlite" import ( diff --git a/tcl_test.go b/tcl_test.go index 2914e05..822dc01 100644 --- a/tcl_test.go +++ b/tcl_test.go @@ -31,6 +31,10 @@ func TestTclTest(t *testing.T) { t.Skip("skipping test in short mode") } + if err := setMaxOpenFiles(1024); err != nil { // Avoid misc7.test hanging for a long time. + t.Fatal(err) + } + blacklist := map[string]struct{}{} switch runtime.GOARCH { case "386", "arm": @@ -51,16 +55,8 @@ func TestTclTest(t *testing.T) { blacklist["tclsqlite.test"] = struct{}{} blacklist["vtabA.test"] = struct{}{} blacklist["windowC.test"] = struct{}{} - case "ppc64le", "riscv64": - if err := setMaxOpenFiles(1024); err != nil { // Avoid misc7.test hanging for a long time. - t.Fatal(err) - } } switch runtime.GOOS { - case "freebsd": - if err := setMaxOpenFiles(1024); err != nil { // Avoid misc7.test hanging for a long time. - t.Fatal(err) - } case "windows": // See https://gitlab.com/cznic/sqlite/-/issues/23#note_599920077 for details. blacklist["symlink2.test"] = struct{}{}