cyb70289 commented on code in PR #13662:
URL: https://github.com/apache/arrow/pull/13662#discussion_r938386723
##########
cpp/src/arrow/util/io_util.cc:
##########
@@ -1115,7 +1116,9 @@ Result<FileDescriptor> FileOpenWritable(const
PlatformFilename& file_name,
fd = FileDescriptor(ret);
#else
int oflag = O_CREAT;
-
+ if (sync) {
+ oflag |= O_SYNC;
Review Comment:
It's purely from coding perspective.
As `O_SYNC` is rarely used, avoiding the flag and adding `fdatasync`
explicitly before `fadvice` make the code easier to read IMHO.
An additional syscall is probably not a worry. I think the use case is
infrequent flushing of large data block.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]