summaryrefslogtreecommitdiffstats
path: root/stream/stream_file.c
diff options
context:
space:
mode:
Diffstat (limited to 'stream/stream_file.c')
-rw-r--r--stream/stream_file.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/stream/stream_file.c b/stream/stream_file.c
index 9d22bd5539..c62249bf76 100644
--- a/stream/stream_file.c
+++ b/stream/stream_file.c
@@ -39,6 +39,10 @@
#include <sys/mount.h>
#endif
+#if HAVE_LINUX_FSTATFS
+#include <sys/vfs.h>
+#endif
+
#ifdef __MINGW32__
#include <windows.h>
#endif
@@ -130,6 +134,30 @@ static bool check_stream_network(stream_t *stream)
return false;
}
+#elif HAVE_LINUX_FSTATFS
+static bool check_stream_network(stream_t *stream)
+{
+ struct statfs fs;
+ const uint32_t stypes[] = {
+ 0x5346414F /*AFS*/, 0x61756673 /*AUFS*/, 0x00C36400 /*CEPH*/,
+ 0xFF534D42 /*CIFS*/, 0x73757245 /*CODA*/, 0x19830326 /*FHGFS*/,
+ 0x65735546 /*FUSEBLK*/,0x65735543 /*FUSECTL*/,0x1161970 /*GFS*/,
+ 0x47504653 /*GPFS*/, 0x6B414653 /*KAFS*/, 0x0BD00BD0 /*LUSTRE*/,
+ 0x564C /*NCP*/, 0x6969 /*NFS*/, 0x6E667364 /*NFSD*/,
+ 0xAAD7AAEA /*PANFS*/, 0x50495045 /*PIPEFS*/, 0x517B /*SMB*/,
+ 0xBEEFDEAD /*SNFS*/, 0xBACBACBC /*VMHGFS*/, 0x7461636f /*OCFS2*/,
+ 0
+ };
+ struct priv *priv = stream->priv;
+ if (fstatfs(priv->fd, &fs) == 0) {
+ for (int i=0; stypes[i]; i++) {
+ if (stypes[i] == fs.f_type)
+ return true;
+ }
+ }
+ return false;
+
+}
#elif defined(__MINGW32__)
static bool check_stream_network(stream_t *stream)
{