Commit b39c7630 authored by Konstantin Khlebnikov's avatar Konstantin Khlebnikov

use macos fcntl F_NOCACHE

parent 3485b25b
......@@ -400,8 +400,10 @@ int main (int argc, char **argv)
errx(1, "request size must be greather than zero");
flags = O_RDONLY;
#ifdef O_DIRECT
if (direct)
flags |= O_DIRECT;
#endif
if (stat(path, &st))
err(2, "stat \"%s\" failed", path);
......@@ -470,6 +472,11 @@ int main (int argc, char **argv)
err(2, "failed to open \"%s\"", path);
}
#ifdef __APPLE__
if (fcntl(fd, F_NOCACHE, direct))
err(2, "fcntl nocache failed");
#endif
if (!cached) {
ret = posix_fadvise(fd, offset, wsize, POSIX_FADV_RANDOM);
if (ret)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment