- Add support for
UFFDIO_CONTINUEandUFFDIO_REGISTER_MODE_MINORunder the newlinux5_13feature.
IoctlFlagsaccepts unknown flags (e.g. due to future kernel changes).Error::UnrecognizedIoctlsis removed.
-
Added
Uffd::read_eventsthat can read multiple events from the userfaultfd file descriptor. -
Updated
bitflagsdependency to2.2.1. -
Use
/dev/userfaultfdas the default API for creating userfaultfd file descriptors.Since Linux 5.11 a process can select if it wants to handle page faults triggered in kernel space or not. Under this mechanism, processes that wish to handle those, need to have
CAP_SYS_PTRACEcapability.CAP_SYS_PTRACEallows a process to do much more than create userfault fds, so with 6.1 Linux introduces/dev/userfaultfd, a special character device that allows creating userfault file descriptors using theUSERFAULTFD_IOC_NEWioctl. Access to this device is granted via file system permissions and does not requireCAP_SYS_PTRACEto handle kernel triggered page faults.We now default to using
/dev/userfaultfdfor creating the descriptors and only if that file is not present, we fall back to using the syscall.
- Added support for the
UFFD_FEATURE_THREAD_IDflag when compiled with thelinux4_14Cargo feature.
- Update
bindgendependency ofuserfaultfd-systo0.57. Thank you @jgowans
- Make
ReadWritepublic. Thank you @electroCutie
-
Removed the compile-time Linux version check, and replaced it with a Cargo feature.
The Linux version check was overly restrictive, even on systems that did have the right kernel version installed but had older headers in
/usr/include/linux. Beyond that, this check made it more difficult to compile on a different host than what's targeted.There is now a
linux4_14feature flag onuserfaultfd-sys, which turns on and tests the extra constants available in that version. Sinceuserfaultfddid not make use of any of those newer features, it doesn't have a feature flag yet.Applications should take care when initializing with
UffdBuilderto specify the features and ioctls they require, so that an unsupported version will be detected at runtime.
- Initial public release of userfaultfd-rs.