It seems to me that we could implement prefetching support
(USE_PREFETCH) on macOS using the fcntl() command F_RDADVISE. The man
page description is a bit terse:
F_RDADVISE Issue an advisory read async with no copy to user.
But it seems to be the right idea. Was this looked into before? I
couldn't find anything in the archives.
Attached is a patch to implement this. It seems to work, but of course
it's kind of hard to tell whether it actually does anything useful.
(Even if the performance effects were negligible, this would be useful
to get the prefetch code some exercise on this platform.)
Thoughts?