diff --git a/modules/access/file.c b/modules/access/file.c index 0bb9045..9ca3c95 100644 --- a/modules/access/file.c +++ b/modules/access/file.c @@ -32,6 +32,9 @@ #include #include #include +#ifdef __APPLE__ +# include +#endif #ifdef HAVE_FSTATVFS # include # if defined (HAVE_SYS_MOUNT_H) @@ -74,7 +77,7 @@ struct access_sys_t #if !defined (_WIN32) && !defined (__OS2__) static bool IsRemote (int fd) { -#if defined(__APPLE__) +#if defined(__APPLE__) && !TARGET_OS_IPHONE /* This has to preceed the general fstatvfs implmentation below, * as even though Darwin has fstatvfs, it does not expose the * MNT_LOCAL in the statvfs.f_flag field. @@ -86,6 +89,16 @@ static bool IsRemote (int fd) return !((sfs.f_flags & MNT_LOCAL) == MNT_LOCAL); +#elif defined(__APPLE__) + /* + * iOS and tvOS do not need to inspect the backing filesystem to play a + * file. Falling back to the same local-file behavior used when Darwin's + * fstatfs() fails keeps file access, seeking and decoding intact while + * avoiding filesystem classification on those platforms. + */ + (void)fd; + return false; + #elif defined (HAVE_FSTATVFS) && defined (MNT_LOCAL) struct statvfs stf;