From 48801a41a73d4db6fc0fa1cf13c6e1e17b8ea09b Mon Sep 17 00:00:00 2001 From: Brian Cox Date: Wed, 25 May 2016 23:42:26 -0700 Subject: [PATCH] Add direct i/o for Solaris, via the directio() syscall. --- src/core/file_unix.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/core/file_unix.cpp b/src/core/file_unix.cpp index 8d60a2e..a1728da 100644 --- a/src/core/file_unix.cpp +++ b/src/core/file_unix.cpp @@ -217,10 +217,15 @@ void cFile::Open( const TSTRING& sFileNameC, uint32 flags ) cFile::Rewind(); #ifdef F_NOCACHE - if (flags & OPEN_DIRECT) + if ((flags & OPEN_DIRECT) && (flags & OPEN_SCANNING)) fcntl(fh, F_NOCACHE, 1); #endif +#ifdef __sun + if ((flags & OPEN_DIRECT) && (flags & OPEN_SCANNING)) + directio(fh, DIRECTIO_ON); +#endif + #ifdef HAVE_POSIX_FADVISE if (flags & OPEN_SCANNING) { posix_fadvise(fh,0,0, POSIX_FADV_SEQUENTIAL);