Skip to content

Commit

Permalink
Always define __MAP_64
Browse files Browse the repository at this point in the history
When OMRPORT_MMAP_FLAG_ZOS_64BIT is passed in, we should always set flag
__MAP_64

Related to eclipse-openj9/openj9#17073

Signed-off-by: Hang Shao <hangshao@ca.ibm.com>
  • Loading branch information
hangshao0 committed May 12, 2023
1 parent 779c51b commit 8102104
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions port/unix/omrmmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,14 @@
#endif /* !defined(MAP_FAILED) */
#endif /* defined(J9ZOS390) */

#if defined(J9ZOS39064)
#if !defined(__MAP_64)
#define __MAP_64 0x10
#endif /* !defined(__MAP_64) */
#define ZOS_V2R4_RELEASE 27.00
#define ZOS_V2R4_VERSION 4
#endif /* defined(J9ZOS39064) */

#if defined(AIXPPC)
#include <sys/shm.h>
#include <sys/vminfo.h>
Expand Down Expand Up @@ -205,11 +213,21 @@ omrmmap_map_file(struct OMRPortLibrary *portLibrary, intptr_t file, uint64_t off
spCount++;
}

#if defined(J9ZOS39064) && defined(__MAP_64)
#if defined(J9ZOS39064)
if (OMR_ARE_ANY_BITS_SET(flags, OMRPORT_MMAP_FLAG_ZOS_64BIT)) {
mmapFlags |= __MAP_64;
if (zos_version_at_least(ZOS_V2R4_RELEASE, ZOS_V2R4_VERSION)) {
mmapFlags |= __MAP_64;
} else {
Trc_PRT_mmap_map_file_unix_invalidFlags();
errMsg = portLibrary->nls_lookup_message(portLibrary,
J9NLS_ERROR | J9NLS_DO_NOT_APPEND_NEWLINE,
J9NLS_PORT_MMAP_INVALID_MEMORY_PROTECTION,
NULL);
portLibrary->error_set_last_error_with_message(portLibrary, OMRPORT_ERROR_MMAP_MAP_FILE_INVALIDFLAGS, errMsg);
return NULL;
}
}
#endif /* defined(J9ZOS39064) && defined(__MAP_64) */
#endif /* defined(J9ZOS39064) */

if (1 != rwCount) {
Trc_PRT_mmap_map_file_unix_invalidFlags();
Expand Down

0 comments on commit 8102104

Please sign in to comment.