summaryrefslogtreecommitdiff
path: root/libfec/fec_open.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libfec/fec_open.cpp')
-rw-r--r--libfec/fec_open.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/libfec/fec_open.cpp b/libfec/fec_open.cpp
index f25aa7fb..1923406f 100644
--- a/libfec/fec_open.cpp
+++ b/libfec/fec_open.cpp
@@ -14,7 +14,6 @@
* limitations under the License.
*/
-#include <linux/fs.h>
#include <stdlib.h>
#include <sys/ioctl.h>
#include <sys/stat.h>
@@ -24,6 +23,14 @@ extern "C" {
#include <ext4_sb.h>
}
+#if defined(__linux__)
+ #include <linux/fs.h>
+#elif defined(__APPLE__)
+ #include <sys/disk.h>
+ #define BLKGETSIZE64 DKIOCGETBLOCKCOUNT
+ #define fdatasync(fd) fcntl((fd), F_FULLFSYNC)
+#endif
+
#include "fec_private.h"
/* used by `find_offset'; returns metadata size for a file size `size' and