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.
|
// disabled, enabling this may reduce performance.
|
||||||
//
|
//
|
||||||
// One reason to disable caching is that it may help the operating
|
// One reason to disable caching is that it may help the operating
|
||||||
// system from growing its file cache indefinitely. Since some OSes
|
// system from growing its file cache indefinitely.
|
||||||
// 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.
|
|
||||||
disk_io_write_mode,
|
disk_io_write_mode,
|
||||||
disk_io_read_mode,
|
disk_io_read_mode,
|
||||||
|
|
||||||
|
|
|
@ -1308,6 +1308,9 @@ namespace libtorrent
|
||||||
#endif
|
#endif
|
||||||
#ifdef O_DIRECT
|
#ifdef O_DIRECT
|
||||||
| ((mode & direct_io) ? O_DIRECT : 0)
|
| ((mode & direct_io) ? O_DIRECT : 0)
|
||||||
|
#endif
|
||||||
|
#ifdef O_SYNC
|
||||||
|
| ((mode & no_cache) ? O_SYNC: 0)
|
||||||
#endif
|
#endif
|
||||||
, permissions);
|
, permissions);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue