[libcxx-commits] [PATCH] D137132: [libc++][Android] Use fopen/ftruncate64/off64_t on 32-bit Bionic

Ryan Prichard via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Oct 31 16:01:04 PDT 2022


rprichard created this revision.
rprichard added reviewers: ldionne, danalbert.
Herald added a subscriber: danielkiss.
Herald added a project: All.
rprichard requested review of this revision.
Herald added a project: libc++.
Herald added a subscriber: libcxx-commits.
Herald added a reviewer: libc++.

Bionic didn't add fopen64 until API 24, but there's no meaningful
distinction between them with Bionic, so just use fopen instead.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D137132

Files:
  libcxx/test/support/filesystem_test_helper.h


Index: libcxx/test/support/filesystem_test_helper.h
===================================================================
--- libcxx/test/support/filesystem_test_helper.h
+++ libcxx/test/support/filesystem_test_helper.h
@@ -190,6 +190,12 @@
         auto large_file_fopen = fopen;
         auto large_file_ftruncate = utils::ftruncate;
         using large_file_offset_t = off_t;
+#elif defined(__BIONIC__)
+        // Bionic does not distinguish between fopen and fopen64, and it has an
+        // ftruncate64 that accepts off64_t.
+        auto large_file_fopen = fopen;
+        auto large_file_ftruncate = ftruncate64;
+        using large_file_offset_t = off64_t;
 #else
         auto large_file_fopen = fopen64;
         auto large_file_ftruncate = ftruncate64;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D137132.472172.patch
Type: text/x-patch
Size: 767 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20221031/ac939524/attachment.bin>


More information about the libcxx-commits mailing list