Skip to content

Commit

Permalink
Merge pull request #3009 from MirServer/fix-alpine-edge
Browse files Browse the repository at this point in the history
Fix the Alpine/edge FTBFS
  • Loading branch information
Saviq committed Aug 22, 2023
1 parent dadb1f1 commit 65a0f9c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/mir_test_framework/mmap_wrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,14 @@ void* mmap(void *addr, size_t length, int prot, int flags, int fd, off_t offset)
void* (*real_mmap)(void *addr, size_t length, int prot, int flags, int fd, off_t offset);
*(void **)(&real_mmap) = dlsym(RTLD_NEXT, real_mmap_symbol_name());

#if _FILE_OFFSET_BITS == 64
// Empirically, mmap64 is NOT defined everywhere, but on 64-bit platforms this is appropriate
if (!real_mmap)
{
*(void **)(&real_mmap) = dlsym(RTLD_NEXT, "mmap");
}
#endif

if (!real_mmap)
{
using namespace std::literals::string_literals;
Expand Down

0 comments on commit 65a0f9c

Please sign in to comment.