Selaa lähdekoodia

Set F_GLOBAL_NOCACHE for Mac OS X

Tatsuhiro Tsujikawa 13 vuotta sitten
vanhempi
commit
74520b03f8
1 muutettua tiedostoa jossa 3 lisäystä ja 0 poistoa
  1. 3 0
      src/AbstractDiskWriter.cc

+ 3 - 0
src/AbstractDiskWriter.cc

@@ -118,6 +118,9 @@ int openFileWithFlags(const std::string& filename, int flags,
                                    util::safeStrerror(errNum).c_str()),
                        errCode);
   }
+#if defined(__APPLE__) && defined(__MACH__)
+  fcntl(fd, F_GLOBAL_NOCACHE, 1);
+#endif // __APPLE__ && __MACH__
   return fd;
 }
 } // namespace