Repository navigation
fix(fs): Set proper inotify WatchFlags values on libc backend - #1714
Open
AlexTMjugador wants to merge 1 commit into
Open
AlexTMjugador wants to merge 1 commit into
AlexTMjugador wants to merge 1 commit into
Conversation
bytecodealliance#479 added `inotify` API support to `rustix`, and hardcoded the values of the `EXCL_UNLINK`, `MASK_ADD`, and `MASK_CREATE` `WatchFlags` to 1 for the `libc` backend. This is incorrect and causes the API to silently misbehave when using that backend, because 1 corresponds to the `IN_ACCESS` flag instead, as [the corresponding kernel UAPI definitions show](https://elixir.bootlin.com/linux/v7.2.11/source/include/uapi/linux/inotify.h#L53-L59). However, the `libc` crate has had all the required `inotify` flags since version 0.2.139, which was released a few weeks after PR bytecodealliance#479 was submitted: rust-lang/libc@ec6d846. `rustix` currently depends on `libc` 0.2.182, which is well above `libc` 0.2.139, so let's take the correct flag definitions from there instead.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
#479 added
inotifyAPI support torustix, and hardcoded the values of theEXCL_UNLINK,MASK_ADD, andMASK_CREATEWatchFlagsto 1 for thelibcbackend. This is incorrect and causes the API to silently misbehave when using that backend, because 1 corresponds to theIN_ACCESSflag instead, as the corresponding kernel UAPI definitions show.However, the
libccrate has had all the requiredinotifyflags since version 0.2.139, which was released a few weeks after PR #479 was submitted: rust-lang/libc@ec6d846.rustixcurrently depends onlibc0.2.182, which is well abovelibc0.2.139, so let's take the correct flag definitions from there instead.