For the portable, POSIX.1-specified method of ensuring that
space is allocated for a file.
The main reason of this patch is to support GCC 9.2.
ref) https://review.tizen.org/gerrit/gitweb?p=platform%2Fcore%2Fsecurity%2Fode.git;a=shortlog;h=refs%2Fheads%2Fsandbox%2Fakazmin%2Ftizen_6.0_build
Change-Id: I8baf4feb5fce364f6ecf0ba08c46b90ac7ca1457
Signed-off-by: Sangwan Kwon <sangwan.kwon@samsung.com>
if (blkcnt <= MAX_LOG_LEN)
return;
- ret = ::fallocate(fd, FALLOC_FL_COLLAPSE_RANGE, 0, blksize*(blkcnt-MAX_LOG_LEN));
+ ret = ::posix_fallocate(fd, 0, blksize*(blkcnt-MAX_LOG_LEN));
if (ret < 0)
std::cerr << "Failed to collapse the log file : " << errno << std::endl;
}