Add direct i/o for Solaris, via the directio() syscall.

This commit is contained in:
Brian Cox 2016-05-25 23:42:26 -07:00
parent 64a5bab856
commit 48801a41a7
1 changed files with 6 additions and 1 deletions

View File

@ -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);