When we mmap a file, we don't take into consideration whether the file is on a remote share. mmaping such a file is problematic because if the network share goes away -- which can happen for reasons outside of the user's control -- anything trying to read from that file will have undefined behavior.
LLDB already has logic to check whether a file is local or remote, but it was not implemented on Windows.
Also, mmap on newer versions of OSX have some additional flags which LLDB requires and which I see no reason to ever NOT include even for general usage, so the low level call to mmap is udpated to use those flags when available.
Note that I do not have any non-Windows machine to test on, so I'm including a lot of people from various platforms here to look over this:
Getting the statvfs / statfs distiction correct was tricky, but hopefully I got this correct. FWIU,
NetBSD: statfs does not exist! Must use statvfs for everything. Reference
FreeBSD: statvfs::f_flag does not contain MNT_LOCAL. Must use statfs. Reference
OpenBSD: Both functions exist, but documentation does not specify whether the flags differ between the two.
Since FreeBSD cannot use statvfs to check for MNT_LOCAL, I'm adjusting the conditional in Path.inc so that FreeBSD and OpenBSD follow the same codepath. Nothing was broken before, it's only now that we need to use f_flag & MNT_LOCAL that FreeBSD requires a change to use statfs instead.