Skip to content

Conversation

@redstar
Copy link
Member

@redstar redstar commented Nov 4, 2025

_XPLATFORM_SOURCE needs to be defined to improve source code compatibility (e.g. for O_CLOEXEC). The define _UNIX03_THREADS can be removed, because it is automatically set by _XOPEN_SOURCE=600.

See the documentation of feature test macros: https://www.ibm.com/docs/en/zos/3.1.0?topic=files-feature-test-macros

Tested on z/OS 3.1 with the Open XL C/C++ 2.2 compiler.

`_XPLATFORM_SOURCE` needs to be defined to improve source code compatibility (e.g. for `O_CLOEXEC`).
The define `_UNIX03_THREADS` can be removed, because it is automatically set by `_XOPEN_SOURCE=600`.

See the documentation of feature test macros: https://www.ibm.com/docs/en/zos/3.1.0?topic=files-feature-test-macros

Tested on z/OS 3.1 with the Open XL C/C++ 2.2 compiler.
@redstar redstar self-assigned this Nov 4, 2025
Copy link
Contributor

@abhina-sree abhina-sree left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

# Build with _XOPEN_SOURCE on z/OS.
if (CMAKE_SYSTEM_NAME MATCHES "OS390")
add_compile_definitions(_XOPEN_SOURCE=600)
add_compile_definitions(_XPLATFORM_SOURCE)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: can we add a comment that we need this for O_CLOEXEC

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed.

Copy link
Contributor

@perry-ca perry-ca left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@redstar redstar merged commit 2a65fab into main Nov 4, 2025
8 of 9 checks passed
@redstar redstar deleted the users/redstar/zoscompile branch November 4, 2025 20:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants