Skip to content

Commit

Permalink
Merge pull request #34 from fwang2/master
Browse files Browse the repository at this point in the history
skip fallocate on Mac, #23
  • Loading branch information
fwang2 authored Aug 30, 2018
2 parents b037cbb + dded9c0 commit 3093ec2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/posix.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 3093ec2

Please sign in to comment.