0
0
mirror of https://gitlab.com/cznic/sqlite.git synced 2025-05-17 23:26:41 +00:00
Files
go-sqlite/rlimit.go

20 lines
434 B
Go
Raw Normal View History

2021-09-06 16:25:17 +02:00
// 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.
2022-07-25 10:19:12 +02:00
//go:build freebsd
// +build freebsd
2021-09-06 16:25:17 +02:00
package sqlite // import "modernc.org/sqlite"
import (
"golang.org/x/sys/unix"
)
2021-09-06 20:57:10 +02:00
func setMaxOpenFiles(n int64) error {
2021-09-06 16:25:17 +02:00
var rLimit unix.Rlimit
2021-09-06 20:57:10 +02:00
rLimit.Max = n
rLimit.Cur = n
2021-09-06 16:25:17 +02:00
return unix.Setrlimit(unix.RLIMIT_NOFILE, &rLimit)
}