Versions in this module Expand all Collapse all v0 v0.1.0 Mar 13, 2026 Changes in this version + const NR_userfaultfd — darwin/amd64, js/wasm, windows/amd64 + const UFFDIO_API + const UFFDIO_COPY + const UFFDIO_MOVE + const UFFDIO_REGISTER + const UFFDIO_REGISTER_MODE_MISSING + const UFFD_API + const UFFD_EVENT_PAGEFAULT + const UFFD_FEATURE_MOVE + const UFFD_OPEN_DEFAULT + const UFFD_O_CLOEXEC + const UFFD_O_NONBLOCK + const UFFD_USER_MODE_ONLY + var ErrInvalidFDsLength = errors.New("invalid file descriptors length") + var ErrInvalidPopulateRange = errors.New("populate range must be page aligned") + var ErrUnexpectedEventType = errors.New("unexpected event type") + var ErrUnsupportedPlatform = errors.New("userfaultfd is unsupported on this platform") + func CheckSupport() error + func CheckSupportWithFlags(flags uintptr) error + func GetCopyBytes(copy *UffdioCopy) int64 + func GetMoveBytes(move *UffdioMove) int64 + func GetMsgArg(msg *UffdMsg) [24]byte + func GetMsgEvent(msg *UffdMsg) uint8 + func GetPagefaultAddress(pagefault *UffdPagefault) uint64 + func Handle(uffd UFFD, start uintptr, src io.ReaderAt) error + func HandleContext(ctx context.Context, uffd UFFD, start uintptr, src io.ReaderAt) error + func Populate(uffd UFFD, address uintptr, data []byte) (int64, error) — linux/amd64 + func PopulateMove(uffd UFFD, address uintptr, data []byte) (int64, error) — linux/amd64 + func ReceiveFDs(conn *net.UnixConn, num int) ([]uintptr, error) + func SendFDs(conn *net.UnixConn, fds []uintptr) error + func SendUFFD(conn *net.UnixConn, uffd UFFD, start uintptr) error + type Fault struct + Address uintptr + type Handler struct + func NewHandler(uffd UFFD, opts *HandlerOptions) *Handler + func (h *Handler) Serve(ctx context.Context, onFault func(Fault, Resolver) error) error + type HandlerOptions struct + DisableLockOSThread bool + PollTimeout time.Duration + type MoveBuffer []byte + func AllocateMoveBuffer(length int) (MoveBuffer, error) + func (b MoveBuffer) Bytes() []byte + func (b MoveBuffer) Close() error + type Registration struct + func Register(length int) (*Registration, error) + func RegisterWithFlags(length int, flags uintptr) (*Registration, error) + func (r *Registration) Bytes() []byte + func (r *Registration) Close() error + func (r *Registration) Start() uintptr + func (r *Registration) UFFD() UFFD + type Resolver struct + func (r Resolver) Populate(address uintptr, data []byte) (int64, error) + func (r Resolver) PopulateMove(address uintptr, data []byte) (int64, error) + type UFFD uintptr + func Open(flags uintptr) (UFFD, error) + func ReceiveUFFD(conn *net.UnixConn) (UFFD, uintptr, error) + func (u UFFD) Close() error + func (u UFFD) Init(features uint64) error + func (u UFFD) Register(start, length uintptr, mode uint64) error + type UffdMsg struct + Arg [24]byte + Event uint8 + Reserved1 uint8 + Reserved2 uint16 + Reserved3 uint32 + type UffdPagefault struct + Address uint64 + Feat [4]byte + Flags uint64 + Pad_cgo_0 [4]byte + type UffdioAPI struct + Api uint64 + Features uint64 + Ioctls uint64 + func NewUffdioAPI(api, features uint64) UffdioAPI + type UffdioCopy struct + Copy int64 + Dst uint64 + Len uint64 + Mode uint64 + Src uint64 + func NewUffdioCopy(b []byte, address uint64, length uint64, mode uint64, copied int64) UffdioCopy + type UffdioMove struct + Dst uint64 + Len uint64 + Mode uint64 + Move int64 + Src uint64 + func NewUffdioMove(b []byte, address uint64, length uint64, mode uint64, moved int64) UffdioMove + type UffdioRange struct + Len uint64 + Start uint64 + type UffdioRegister struct + Ioctls uint64 + Mode uint64 + Range UffdioRange + func NewUffdioRegister(start, length, mode uint64) UffdioRegister