Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes to further OSX compilation #738

Merged
merged 2 commits into from
Dec 6, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions runtime/oti/j9porterror.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 1998, 2015 IBM Corp. and others
* Copyright (c) 1998, 2017 IBM Corp. and others
*
* This program and the accompanying materials are made available under
* the terms of the Eclipse Public License 2.0 which accompanies this
Expand Down Expand Up @@ -245,15 +245,15 @@
* 0xFFF5xxxx for __getipc (zOS)
* @{
*/
#define J9PORT_ERROR_SYSV_IPC_FTOK_ERROR (-2 << J9PORT_ERROR_SYSTEM_CALL_CODE_SHIFT)
#define J9PORT_ERROR_SYSV_IPC_SEMGET_ERROR (-3 << J9PORT_ERROR_SYSTEM_CALL_CODE_SHIFT)
#define J9PORT_ERROR_SYSV_IPC_SEMCTL_ERROR (-4 << J9PORT_ERROR_SYSTEM_CALL_CODE_SHIFT)
#define J9PORT_ERROR_SYSV_IPC_SEMOP_ERROR (-5 << J9PORT_ERROR_SYSTEM_CALL_CODE_SHIFT)
#define J9PORT_ERROR_SYSV_IPC_SHMGET_ERROR (-6 << J9PORT_ERROR_SYSTEM_CALL_CODE_SHIFT)
#define J9PORT_ERROR_SYSV_IPC_SHMCTL_ERROR (-7 << J9PORT_ERROR_SYSTEM_CALL_CODE_SHIFT)
#define J9PORT_ERROR_SYSV_IPC_SHMAT_ERROR (-8 << J9PORT_ERROR_SYSTEM_CALL_CODE_SHIFT)
#define J9PORT_ERROR_SYSV_IPC_SHMDT_ERROR (-9 << J9PORT_ERROR_SYSTEM_CALL_CODE_SHIFT)
#define J9PORT_ERROR_SYSV_IPC_GETIPC_ERROR (-10 << J9PORT_ERROR_SYSTEM_CALL_CODE_SHIFT)
#define J9PORT_ERROR_SYSV_IPC_FTOK_ERROR ((I_32)((U_32)-2 << J9PORT_ERROR_SYSTEM_CALL_CODE_SHIFT))
#define J9PORT_ERROR_SYSV_IPC_SEMGET_ERROR ((I_32)((U_32)-3 << J9PORT_ERROR_SYSTEM_CALL_CODE_SHIFT))
#define J9PORT_ERROR_SYSV_IPC_SEMCTL_ERROR ((I_32)((U_32)-4 << J9PORT_ERROR_SYSTEM_CALL_CODE_SHIFT))
#define J9PORT_ERROR_SYSV_IPC_SEMOP_ERROR ((I_32)((U_32)-5 << J9PORT_ERROR_SYSTEM_CALL_CODE_SHIFT))
#define J9PORT_ERROR_SYSV_IPC_SHMGET_ERROR ((I_32)((U_32)-6 << J9PORT_ERROR_SYSTEM_CALL_CODE_SHIFT))
#define J9PORT_ERROR_SYSV_IPC_SHMCTL_ERROR ((I_32)((U_32)-7 << J9PORT_ERROR_SYSTEM_CALL_CODE_SHIFT))
#define J9PORT_ERROR_SYSV_IPC_SHMAT_ERROR ((I_32)((U_32)-8 << J9PORT_ERROR_SYSTEM_CALL_CODE_SHIFT))
#define J9PORT_ERROR_SYSV_IPC_SHMDT_ERROR ((I_32)((U_32)-9 << J9PORT_ERROR_SYSTEM_CALL_CODE_SHIFT))
#define J9PORT_ERROR_SYSV_IPC_GETIPC_ERROR ((I_32)((U_32)-10 << J9PORT_ERROR_SYSTEM_CALL_CODE_SHIFT))

#define J9PORT_ERROR_SYSV_IPC_ERRNO_BASE -750
#define J9PORT_ERROR_SYSV_IPC_ERRNO_EACCES (J9PORT_ERROR_SYSV_IPC_ERRNO_BASE)
Expand Down
14 changes: 8 additions & 6 deletions runtime/port/sysvipc/j9shmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -1613,14 +1613,16 @@ openSharedMemory (J9PortLibrary *portLibrary, intptr_t fd, const char *baseFile,
goto failDontUnlink;
}
} else {
#if defined (__GNUC__) || defined (AIXPPC)
#if defined (__GNUC__)
/*Use .__key for __GNUC__*/
if (buf.shm_perm.__key != controlinfo->common.ftok_key)
#endif
#if defined (AIXPPC)
#if defined(__GNUC__) || defined(AIXPPC)
#if defined(OSX)
/*Use ._key for OSX*/
if (buf.shm_perm._key != controlinfo->common.ftok_key)
#elif defined(AIXPPC)
/*Use .key for AIXPPC*/
if (buf.shm_perm.key != controlinfo->common.ftok_key)
#elif defined(__GNUC__)
/*Use .__key for __GNUC__*/
if (buf.shm_perm.__key != controlinfo->common.ftok_key)
#endif
{
Trc_PRT_shmem_j9shmem_openSharedMemory_Msg("The <key,id> pair in our control file is no longer valid.");
Expand Down
19 changes: 10 additions & 9 deletions runtime/port/sysvipc/j9shsem_deprecated.c
Original file line number Diff line number Diff line change
Expand Up @@ -1077,18 +1077,19 @@ openSemaphore(struct J9PortLibrary *portLibrary, intptr_t fd, char *baseFile, j9
goto failDontUnlink;
}
} else {
#if defined (__GNUC__) || defined (AIXPPC) || defined(J9ZTPF)
#if defined (__GNUC__) && !defined(J9ZTPF)
/*Use .__key for __GNUC__*/
if (buf.sem_perm.__key != controlinfo->ftok_key)
#endif
#if defined (AIXPPC)
#if defined(__GNUC__) || defined(AIXPPC) || defined(J9ZTPF)
#if defined(OSX)
/*Use _key for OSX*/
if (buf.sem_perm._key != controlinfo->ftok_key)
#elif defined(AIXPPC)
/*Use .key for AIXPPC*/
if (buf.sem_perm.key != controlinfo->ftok_key)
#endif
#if defined(J9ZTPF)
/*Use .key for z/TPF */
#elif defined(J9ZTPF)
/*Use .key for z/TPF */
if (buf.key != controlinfo->ftok_key)
#elif defined(__GNUC__)
/*Use .__key for __GNUC__*/
if (buf.sem_perm.__key != controlinfo->ftok_key)
#endif
{
Trc_PRT_shsem_j9shsem_opensemaphore_Msg("The <key,id> pair in our control file is no longer valid.");
Expand Down