Go bindings to userfaultfd.
userfaultfd-go
provides Go bindings to userfaultfd, which allows for handling page faults in a memory region in userspace.
It enables you to...
- Expose any
io.ReaderAt
as a Go slice: You can use this feature to work with anyio.ReaderAt
interface as a Go slice, which can be useful when working with external libraries that can't work with Go buffers or readers. - Access remote files as a slice without fetching: With
userfaultfd-go
, you can access a remote file stored in S3 or a file as a slice without needing to fetch its complete contents locally, which can be beneficial when working with large files. - Track changes to
mmap
ed regions: You can track changes made to ammap
ed region by one process from another process.
You can add userfaultfd-go
to your Go project by running the following:
$ go get github.com/loopholelabs/userfaultfd/...@latest
To make getting started with userfaultfd-go
easier, take a look at the following examples:
- bytecodealliance/userfaultfd-rs inspired the API design.
Bug reports and pull requests are welcome on GitHub at https://github.com/loopholelabs/userfaultfd-go. For more contribution information check out the contribution guide.
The userfaultfd-go
project is available as open source under the terms of the Apache License, Version 2.0.
Everyone interacting in the userfaultfd-go
project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the CNCF Code of Conduct.