fcntl: adding macOs F_RDADVISE flag#2480
Conversation
Hints to prefetch blocks of the file into memory when possible. Can be useful to process large files.
SteveLauC
left a comment
There was a problem hiding this comment.
Interesting prefetch feature, can we have a test for this flag, just create a temp file and invoke the call against it:)
There was a problem hiding this comment.
This was accidentally modified, please revert it.
| F_GETPATH_NOFIRMLINK(&'a mut PathBuf), | ||
| /// Issue an advisory read async with no copy to user | ||
| #[cfg(apple_targets)] | ||
| F_RDADVISE(libc::radvisory), |
There was a problem hiding this comment.
I saw this was changed in the "testing" commit, the previous API is indeed a bit unclear:
F_RDADVISE(off_t, c_int),
I am actually thinking about this:
F_RDADVISE {
offset: off_t,
count: c_int,
}So semantically, the API will be more clear and users won't need to bother with the libc raw structure. The drawback is, we need to copy these 2 numbers, considering they are simply numbers, IMHO, it is fine to copy them. Your thoughts? 🤔
There was a problem hiding this comment.
I was being consistent with flags passing libc::flock.
There was a problem hiding this comment.
Get it, makes sense to me then:)
| F_GETPATH_NOFIRMLINK(&'a mut PathBuf), | ||
| /// Issue an advisory read async with no copy to user | ||
| #[cfg(apple_targets)] | ||
| F_RDADVISE(libc::radvisory), |
There was a problem hiding this comment.
Get it, makes sense to me then:)
|
Let's try if the Cirrus CI will be ok in this PR, it fails at cloning the repo in other PRs😵💫 |
Hints to prefetch blocks of the file into memory when possible. Can be useful to process large files.