RFR: 8330989: unify os::create_binary_file across platforms [v2]

David Holmes dholmes at openjdk.org
Sun Apr 28 21:55:10 UTC 2024


On Fri, 26 Apr 2024 07:43:20 GMT, Matthias Baesken <mbaesken at openjdk.org> wrote:

> was there a special reason not to do it here ?

We often use platform specific code in this file rather than "jumping" back out to shared code like`os::xxx`.

> The Windows os::open already adds O_BINARY

And the non-windows `os::open` does a lot of other hacking around close-on-exec. I would rather not change any functionality in this PR as it meant to be a simple refactoring.

It isn't clear to me why `os::create_binary_file` even needed to be introduced but it is day one code for the heapDumper. I suspect it was a wrapper purely to add the O_BINARY flag on Windows. But we have CDS code, for example, the also creates binary files but doesn't use this API. Seems like a candidate for removal to me, but not this PR.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/18918#issuecomment-2081667684


More information about the hotspot-runtime-dev mailing list