diff --git a/lib/Support/Unix/Path.inc b/lib/Support/Unix/Path.inc index a02585c3bdc..05ccc6cc5e4 100644 --- a/lib/Support/Unix/Path.inc +++ b/lib/Support/Unix/Path.inc @@ -492,7 +492,12 @@ std::error_code resize_file(int FD, uint64_t Size) { // 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)) { - if (Err != EINVAL && Err != EOPNOTSUPP) +#ifdef _AIX + constexpr int NotSupportedError = ENOTSUP; +#else + constexpr int NotSupportedError = EOPNOTSUPP; +#endif + if (Err != EINVAL && Err != NotSupportedError) return std::error_code(Err, std::generic_category()); } #endif