Based on ntfs-3g version 2015.3.14 from Tuxera. Initial Android project and "Android glue" was taken from OmniROM repository.
I've built only ntfs-3g
, ntfsfix
and mkntfs
, but didn't test the latter. Other tools may require similar modifications to build and run. I need only ntfs-3g
and ntfsfix
(with -n option only) for my particular tasks.
The changes made are:
- Original source code uses 64-bit off_t type verision, but Android NDK toolchain and libraries ignore
_FILE_OFFSET_BITS=64
and_LARGEFILE_SOURCE
defines. Changed tooff64_t
, and also switched tolseek64
,pread64
,pwrite64
. Note: It is not good to typedefoff_t
as 64-bit integer before including other headers, because it has side effect, in particular, it breaks stream I/O functions in Bionic libc. - Bionic headers define
_STRUCT_TIMESPEC
, but neitherst_mtime
nor__timespec_defined
, as Tuxera expects. - Bionic headers don't define obsolete
S_IREAD
,S_IWRITE
,S_IEXEC
. - Original sources failed to compile with
IGNORE_MTAB
defined. - Android NDK x86 libc has missing
ffs()
function, so I had to undefineHAVE_FFS
. - Starting from 1.0.4, Android build is default to "
noatime
" option, and ignores other values ("atime
", "relatime
") provided from the command line.
TODO: Android file managers don't follow symlinks on user storages. I'd try to implement a mount option to resolve symlinks at the driver side, transparently for applications.