struct statfs {
...
uint32_t f_type; /* type of filesystem */
char f_fstypename[MFSNAMELEN]; /* filesystem type name */
...
}
f_fstypename == "nfs"
f_type == 6
#include <sys/param.h>
#include <sys/mount.h>
int is_local_fs(char const * path)
{
struct statfs sb;
if (statfs(path, &sb) == -1) {
perror(path);
return 0;
}
return sb.f_flags & MNT_LOCAL;
}