I propose exposing the std::os::fd::AsRawFd
trait method for nix::sys::fanotify::Fanotify
struct
#2575
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello everyone! I propose exposing the
AsRawFd
API forFanotify
struct.What does this PR do
This PR forwards the
as_raw_fd()
onFanotify
instance to the underlyingOwnedFd
instance. This is necessary to register the struct with Tokio using theAsyncFd
generic struct, which allows working with fanotify asynchronously -- instead of blocking the current thread, or manually polling file descriptors, anasync
function can use theawait
operator to read events if they are ready, or switch to other task if no events have yet arrived.Checklist:
CONTRIBUTING.md
as_raw_fd()
is already documented by the standard library)