mirror of
https://github.com/DeusData/codebase-memory-mcp.git
synced 2026-11-02 07:53:41 +08:00
Fix linux build: replace removed syscall.Fadvise with unix.Fadvise
syscall.Fadvise was removed in Go 1.26. Use golang.org/x/sys/unix instead.
This commit is contained in:
@@ -7,6 +7,7 @@ require (
|
||||
github.com/modelcontextprotocol/go-sdk v1.4.0
|
||||
github.com/zeebo/xxh3 v1.1.0
|
||||
golang.org/x/sync v0.19.0
|
||||
golang.org/x/sys v0.40.0
|
||||
gopkg.in/yaml.v3 v3.0.1
|
||||
)
|
||||
|
||||
@@ -17,5 +18,4 @@ require (
|
||||
github.com/segmentio/encoding v0.5.3 // indirect
|
||||
github.com/yosida95/uritemplate/v3 v3.0.2 // indirect
|
||||
golang.org/x/oauth2 v0.34.0 // indirect
|
||||
golang.org/x/sys v0.40.0 // indirect
|
||||
)
|
||||
|
||||
@@ -4,7 +4,8 @@ package pipeline
|
||||
|
||||
import (
|
||||
"os"
|
||||
"syscall"
|
||||
|
||||
"golang.org/x/sys/unix"
|
||||
)
|
||||
|
||||
func advisePrefetch(f *os.File) {
|
||||
@@ -13,5 +14,5 @@ func advisePrefetch(f *os.File) {
|
||||
return
|
||||
}
|
||||
// POSIX_FADV_WILLNEED = 3: advise kernel to read file into page cache
|
||||
_ = syscall.Fadvise(int(f.Fd()), 0, fi.Size(), 3)
|
||||
_ = unix.Fadvise(int(f.Fd()), 0, fi.Size(), unix.FADV_WILLNEED)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user