Files
bsdaily/internal/bsdaily/copy_linux.go
sneak 7316054b07 Add README, LICENSE, Makefile, Dockerfile, and CI
Add a detailed README, WTFPL LICENSE, and build/CI tooling modeled on
the vaultik repo (Makefile, multi-stage digest-pinned Dockerfile,
.gitea/workflows/check.yml). Bump Go to 1.26.4 and pin golangci-lint
to v2.12.2. gofmt existing sources so the new fmt-check gate passes.
2026-06-28 10:08:44 +02:00

17 lines
305 B
Go

//go:build linux
package bsdaily
import (
"golang.org/x/sys/unix"
"os"
)
func applyFileAdvice(file *os.File, size int64) {
fd := int(file.Fd())
// POSIX_FADV_SEQUENTIAL = 2
_ = unix.Fadvise(fd, 0, size, 2)
// POSIX_FADV_WILLNEED = 3 - prefetch file into cache
_ = unix.Fadvise(fd, 0, size, 3)
}