Index: lib/Support/Unix/Path.inc =================================================================== --- lib/Support/Unix/Path.inc +++ lib/Support/Unix/Path.inc @@ -422,7 +422,10 @@ // If we have posix_fallocate use it. Unlike ftruncate it always allocates // space, so we get an error if the disk is full. if (int Err = ::posix_fallocate(FD, 0, Size)) - return std::error_code(Err, std::generic_category()); + if (Err != EOPNOTSUPP) + return std::error_code(Err, std::generic_category()); + if (::ftruncate(FD, Size) == -1) + return std::error_code(errno, std::generic_category()); #else // Use ftruncate as a fallback. It may or may not allocate space. At least on // OS X with HFS+ it does.