qnx: make mman_impl LP64-safe; use ::mmap/::mem_offset on QNX LP64 and include <sys/mman.h>, <sys/types.h> #27
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
When building on QNX LP64 (e.g., Neutrino 8 x86_64), the 64-suffixed APIs are often not declared because the non-suffixed ones already use 64-bit off_t. Calling ::mmap64 / ::mem_offset64 unconditionally produces errors like:
'::mmap64' has not been declared
'::mem_offset64' has not been declared
What this PR does
Adds the missing system headers <sys/mman.h> and <sys/types.h> at the top of mman_impl.cpp.
Uses feature checks to select the correct calls:
On QNX && LP64, mmap64() delegates to ::mmap(...) (already 64-bit).
On QNX && LP64, mem_offset64() delegates to ::mem_offset(...) (already 64-bit).
On all other platforms, behavior is unchanged (still calls the 64-suffixed versions).
Why this is correct
On LP64 systems, off_t is 64-bit, so the non-suffixed calls already use wide offsets.
QNX headers may not even declare the “64” symbols on LP64 because they are redundant.