diff --git a/llvm/cmake/config-ix.cmake b/llvm/cmake/config-ix.cmake index fabafe10f4f01c..7e9d76d6c56487 100644 --- a/llvm/cmake/config-ix.cmake +++ b/llvm/cmake/config-ix.cmake @@ -243,7 +243,6 @@ check_symbol_exists(setrlimit sys/resource.h HAVE_SETRLIMIT) check_symbol_exists(isatty unistd.h HAVE_ISATTY) check_symbol_exists(futimens sys/stat.h HAVE_FUTIMENS) check_symbol_exists(futimes sys/time.h HAVE_FUTIMES) -check_symbol_exists(posix_fallocate fcntl.h HAVE_POSIX_FALLOCATE) # AddressSanitizer conflicts with lib/Support/Unix/Signals.inc # Avoid sigaltstack on Apple platforms, where backtrace() cannot handle it # (rdar://7089625) and _Unwind_Backtrace is unusable because it cannot unwind diff --git a/llvm/include/llvm/Config/config.h.cmake b/llvm/include/llvm/Config/config.h.cmake index 1d982b544a63a9..064d2f27dc18b3 100644 --- a/llvm/include/llvm/Config/config.h.cmake +++ b/llvm/include/llvm/Config/config.h.cmake @@ -152,9 +152,6 @@ /* Define to 1 if you have the `malloc_zone_statistics' function. */ #cmakedefine HAVE_MALLOC_ZONE_STATISTICS ${HAVE_MALLOC_ZONE_STATISTICS} -/* Define to 1 if you have the `posix_fallocate' function. */ -#cmakedefine HAVE_POSIX_FALLOCATE ${HAVE_POSIX_FALLOCATE} - /* Define to 1 if you have the `posix_spawn' function. */ #cmakedefine HAVE_POSIX_SPAWN ${HAVE_POSIX_SPAWN} diff --git a/llvm/lib/Support/Unix/Path.inc b/llvm/lib/Support/Unix/Path.inc index 19d89db556273b..f5cb5895d95d7d 100644 --- a/llvm/lib/Support/Unix/Path.inc +++ b/llvm/lib/Support/Unix/Path.inc @@ -590,19 +590,6 @@ std::error_code rename(const Twine &from, const Twine &to) { } std::error_code resize_file(int FD, uint64_t Size) { -#if defined(HAVE_POSIX_FALLOCATE) - // 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)) { -#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 // Use ftruncate as a fallback. It may or may not allocate space. At least on // OS X with HFS+ it does. if (::ftruncate(FD, Size) == -1) diff --git a/llvm/utils/gn/secondary/llvm/include/llvm/Config/BUILD.gn b/llvm/utils/gn/secondary/llvm/include/llvm/Config/BUILD.gn index c7d7a37a2c169b..8e22f8984cf9c3 100644 --- a/llvm/utils/gn/secondary/llvm/include/llvm/Config/BUILD.gn +++ b/llvm/utils/gn/secondary/llvm/include/llvm/Config/BUILD.gn @@ -143,7 +143,6 @@ write_cmake_config("config") { "HAVE_LINK_H=1", "HAVE_LSEEK64=1", "HAVE_MALLINFO=1", - "HAVE_POSIX_FALLOCATE=1", "HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC=1", ] } else { @@ -152,7 +151,6 @@ write_cmake_config("config") { "HAVE_LINK_H=", "HAVE_LSEEK64=", "HAVE_MALLINFO=", - "HAVE_POSIX_FALLOCATE=", "HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC=", ] } diff --git a/utils/bazel/llvm-project-overlay/llvm/config.bzl b/utils/bazel/llvm-project-overlay/llvm/config.bzl index 8750ad9cf43a5a..2046b2645362f2 100644 --- a/utils/bazel/llvm-project-overlay/llvm/config.bzl +++ b/utils/bazel/llvm-project-overlay/llvm/config.bzl @@ -43,7 +43,6 @@ linux_defines = posix_defines + [ "HAVE_LINK_H=1", "HAVE_LSEEK64=1", "HAVE_MALLINFO=1", - "HAVE_POSIX_FALLOCATE=1", "HAVE_SBRK=1", "HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC=1", ] diff --git a/utils/bazel/llvm-project-overlay/llvm/include/llvm/Config/config.h b/utils/bazel/llvm-project-overlay/llvm/include/llvm/Config/config.h index e6c84b6dda2ddc..4045011394947c 100644 --- a/utils/bazel/llvm-project-overlay/llvm/include/llvm/Config/config.h +++ b/utils/bazel/llvm-project-overlay/llvm/include/llvm/Config/config.h @@ -165,9 +165,6 @@ /* Define to 1 if you have the `malloc_zone_statistics' function. */ /* HAVE_MALLOC_ZONE_STATISTICS defined in Bazel */ -/* Define to 1 if you have the `posix_fallocate' function. */ -/* HAVE_POSIX_FALLOCATE defined in Bazel */ - /* Define to 1 if you have the `posix_spawn' function. */ #define HAVE_POSIX_SPAWN 1 diff --git a/utils/bazel/llvm_configs/config.h.cmake b/utils/bazel/llvm_configs/config.h.cmake index 1d982b544a63a9..064d2f27dc18b3 100644 --- a/utils/bazel/llvm_configs/config.h.cmake +++ b/utils/bazel/llvm_configs/config.h.cmake @@ -152,9 +152,6 @@ /* Define to 1 if you have the `malloc_zone_statistics' function. */ #cmakedefine HAVE_MALLOC_ZONE_STATISTICS ${HAVE_MALLOC_ZONE_STATISTICS} -/* Define to 1 if you have the `posix_fallocate' function. */ -#cmakedefine HAVE_POSIX_FALLOCATE ${HAVE_POSIX_FALLOCATE} - /* Define to 1 if you have the `posix_spawn' function. */ #cmakedefine HAVE_POSIX_SPAWN ${HAVE_POSIX_SPAWN}