mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-02-12 07:40:17 +00:00
8b74cad422
Bumps [github.com/tdewolff/minify/v2](https://github.com/tdewolff/minify) from 2.21.2 to 2.21.3. - [Release notes](https://github.com/tdewolff/minify/releases) - [Commits](https://github.com/tdewolff/minify/compare/v2.21.2...v2.21.3) --- updated-dependencies: - dependency-name: github.com/tdewolff/minify/v2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
32 lines
766 B
Go
32 lines
766 B
Go
//go:build !windows && !darwin && !freebsd
|
|
|
|
package internal
|
|
|
|
import (
|
|
"syscall"
|
|
|
|
"golang.org/x/sys/unix"
|
|
)
|
|
|
|
var (
|
|
SyscallEACCES = syscall.EACCES
|
|
UnixEACCES = unix.EACCES
|
|
)
|
|
|
|
var maxfiles uint64
|
|
|
|
func SetRlimit() {
|
|
// Go 1.19 will do this automatically: https://go-review.googlesource.com/c/go/+/393354/
|
|
var l syscall.Rlimit
|
|
err := syscall.Getrlimit(syscall.RLIMIT_NOFILE, &l)
|
|
if err == nil && l.Cur != l.Max {
|
|
l.Cur = l.Max
|
|
syscall.Setrlimit(syscall.RLIMIT_NOFILE, &l)
|
|
}
|
|
maxfiles = uint64(l.Cur)
|
|
}
|
|
|
|
func Maxfiles() uint64 { return maxfiles }
|
|
func Mkfifo(path string, mode uint32) error { return unix.Mkfifo(path, mode) }
|
|
func Mknod(path string, mode uint32, dev int) error { return unix.Mknod(path, mode, dev) }
|