Browse Source

restructure osx fallocate

pull/384/head
Antonio SJ Musumeci 9 years ago
parent
commit
b0fb5187c4
  1. 16
      src/fs_fallocate_osx.icpp

16
src/fs_fallocate_osx.icpp

@ -20,14 +20,12 @@
#include "fs_fallocate.hpp"
#include "fs_base_ftruncate.hpp"
namespace fs
{
static
int
_fallocate_core(const int fd,
static
int
_fallocate_core(const int fd,
const off_t offset,
const off_t len)
{
{
int rv;
fstore_t store = {F_ALLOCATECONTIG,F_PEOFPOSMODE,offset,len,0};
@ -42,8 +40,10 @@ namespace fs
return rv;
return ::ftruncate(fd,(offset+len));
}
}
namespace fs
{
int
fallocate(const int fd,
const int mode,
@ -53,6 +53,6 @@ namespace fs
if(mode)
return (errno=EOPNOTSUPP,-1);
return _fallocate_core(fd,offset,len);
return ::_fallocate_core(fd,offset,len);
}
}
Loading…
Cancel
Save