MCPcopy Create free account
hub / github.com/catboost/catboost / SetDirectIO

Method SetDirectIO

util/system/direct_io.cpp:76–92  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

74#define DIRECT_IO_FLAGS (O_DIRECT | O_SYNC)
75
76void TDirectIOBufferedFile::SetDirectIO(bool value) {
77#ifdef _linux_
78 if (DirectIO == value) {
79 return;
80 }
81
82 if (!!Alignment && value) {
83 (void)fcntl(File.GetHandle(), F_SETFL, fcntl(File.GetHandle(), F_GETFL) | DIRECT_IO_FLAGS);
84 } else {
85 (void)fcntl(File.GetHandle(), F_SETFL, fcntl(File.GetHandle(), F_GETFL) & ~DIRECT_IO_FLAGS);
86 }
87
88 DirectIO = value;
89#else
90 DirectIO = value;
91#endif
92}
93
94TDirectIOBufferedFile::~TDirectIOBufferedFile() {
95 try {

Callers

nothing calls this directly

Calls 1

GetHandleMethod · 0.45

Tested by

no test coverage detected