mirror of
https://github.com/aaru-dps/fstester.git
synced 2025-12-16 19:24:39 +00:00
Try to use fcntl to create sparse files in Darwin.
This commit is contained in:
@@ -23,11 +23,11 @@ Copyright (C) 2011-2021 Natalia Portillo
|
||||
*****************************************************************************/
|
||||
|
||||
#if defined(__linux__) || defined(__LINUX__) || defined(__gnu_linux)
|
||||
#define _GNU_SOURCE
|
||||
|
||||
#include <dlfcn.h>
|
||||
|
||||
#include "../linux/linux.h"
|
||||
#elif defined(__APPLE__) && defined(__MACH__)
|
||||
#include "../darwin/darwin.h"
|
||||
#endif
|
||||
|
||||
#include <errno.h>
|
||||
@@ -57,6 +57,13 @@ void Sparse(const char* path)
|
||||
|
||||
return;
|
||||
}
|
||||
#elif defined(__APPLE__) && defined(__MACH__)
|
||||
ret = DarwinSparse(path);
|
||||
|
||||
if(ret > 0) return;
|
||||
|
||||
ret = chdir(path);
|
||||
rmdir("SPARSE");
|
||||
#endif
|
||||
|
||||
ret = chdir(path);
|
||||
|
||||
Reference in New Issue
Block a user