1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-26 09:37:56 +00:00

call fcntl(F_NOCACHE,1) right before closing a local datafile. Does it have any effect? Who knows.

This commit is contained in:
Charles Kerr 2010-06-21 13:08:04 +00:00
parent 8d413e98fc
commit 99318552eb

View file

@ -305,6 +305,11 @@ tr_close_file( int fd )
const int err = errno; const int err = errno;
posix_fadvise( fd, 0, 0, POSIX_FADV_DONTNEED ); posix_fadvise( fd, 0, 0, POSIX_FADV_DONTNEED );
errno = err; errno = err;
#endif
#ifdef SYS_DARWIN
/* it's unclear to me from the man pages if this actually flushes out the cache,
* but it couldn't hurt... */
fcntl( fd, F_NOCACHE, 1 );
#endif #endif
close( fd ); close( fd );
} }