posix/fd: only define fallocate wrapper for Linux

This commit is contained in:
Danny Robson 2020-11-30 10:46:33 +10:00
parent 082a0f39b6
commit 2778c073a7
2 changed files with 4 additions and 0 deletions

View File

@ -108,11 +108,13 @@ fd::stat (void) const
///////////////////////////////////////////////////////////////////////////////
#if defined(PLATFORM_LINUX)
void
fd::allocate (int mode, off_t offset, off_t len)
{
error::try_call (fallocate, m_fd, mode, offset, len);
}
#endif
///////////////////////////////////////////////////////////////////////////////

View File

@ -58,8 +58,10 @@ namespace cruft::posix {
///////////////////////////////////////////////////////////////////////
#if defined(PLATFORM_LINUX)
/// A thin wrapper around `fallocate`
void allocate (int mode, off_t offset, off_t len);
#endif
///////////////////////////////////////////////////////////////////////