From 2778c073a73c53492dced6482d1af5628605e87a Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Mon, 30 Nov 2020 10:46:33 +1000 Subject: [PATCH] posix/fd: only define `fallocate` wrapper for Linux --- posix/fd.cpp | 2 ++ posix/fd.hpp | 2 ++ 2 files changed, 4 insertions(+) diff --git a/posix/fd.cpp b/posix/fd.cpp index 46a945f6..bd001ef5 100644 --- a/posix/fd.cpp +++ b/posix/fd.cpp @@ -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 /////////////////////////////////////////////////////////////////////////////// diff --git a/posix/fd.hpp b/posix/fd.hpp index 0babda96..93927f59 100644 --- a/posix/fd.hpp +++ b/posix/fd.hpp @@ -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 ///////////////////////////////////////////////////////////////////////