From dded9c0b33e182d0a11df2f59dd24921edbdfeb4 Mon Sep 17 00:00:00 2001 From: Feiyi Wang Date: Wed, 29 Aug 2018 21:03:31 -0400 Subject: [PATCH] skip fallocate on Mac, #23 --- lib/posix.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/posix.c b/lib/posix.c index 24aafc0..6ba279b 100644 --- a/lib/posix.c +++ b/lib/posix.c @@ -47,10 +47,12 @@ void *posix_write(void *fdes, lcio_job_t *job, off_t flag) { rv = malloc(sizeof(ssize_t)); *rv = 0; +#ifdef HAVE_POSIX_FALLOCATE if(job->ftrunc){ *rv = posix_fallocate(*(int*)fdes, 0, flag); return rv; } +#endif if(flag == 0) { for (i = 0; i < job->blk_sz; i += job->buf_sz) {