forked from premiere/premiere-libtorrent
use O_SYNC when available
This commit is contained in:
parent
774c3b536a
commit
c9903bdaf2
|
@ -941,11 +941,7 @@ namespace libtorrent
|
|||
// disabled, enabling this may reduce performance.
|
||||
//
|
||||
// One reason to disable caching is that it may help the operating
|
||||
// system from growing its file cache indefinitely. Since some OSes
|
||||
// only allow aligned files to be opened in unbuffered mode, It is
|
||||
// recommended to make the largest file in a torrent the first file
|
||||
// (with offset 0) or use pad files to align all files to piece
|
||||
// boundries.
|
||||
// system from growing its file cache indefinitely.
|
||||
disk_io_write_mode,
|
||||
disk_io_read_mode,
|
||||
|
||||
|
|
|
@ -1308,6 +1308,9 @@ namespace libtorrent
|
|||
#endif
|
||||
#ifdef O_DIRECT
|
||||
| ((mode & direct_io) ? O_DIRECT : 0)
|
||||
#endif
|
||||
#ifdef O_SYNC
|
||||
| ((mode & no_cache) ? O_SYNC: 0)
|
||||
#endif
|
||||
, permissions);
|
||||
|
||||
|
|
Loading…
Reference in New Issue