Return std::io::Results from the low level APi and restructure the high level API to take bitflags for the fanotify mark mode, fanotify init flags, and the fd flags for the returned fanotify fd.#16
Conversation
…high level API to take bitflags for the fanotify mark mode, fanotify init flags, and the fd flags for the returned fanotify fd.
|
@pantsman0 Thanks for your work! This looks great overall, but since there are quite a few changes, I'll need some more time to review it thoroughly. |
|
Yeah, no worries at all. I was debugging an issue where fanotify seems to break in weird ways when used on an nfsv4 mount with kerberos auth, and I figured I needed to get a patch in. The handling of extra flags was a bonus due to #12, and the Just some notes. I made the high-level API a feature purely so that I could make the bitfields dependency optional and consumers can opt out. Additionally, the extra records are using |
This started as a debugging session where I was getting errors that were not getting handled properly (os error 13 on
fanotify_read) which made me realise thelibc::readerror handling was completely incorrect.This fixes that error handling, as well as wrapping some of the low level constants into bitflags in the high level API. Theoretically, it should now only be possible to call the high level functions with valid bits in the parameters.
The new structs and functions need docs, but I wanted to get the API here for review @Percivalll .