RFR: 8303942: FileMapInfo::write_bytes aborts on a short os::write
David Holmes
dholmes at openjdk.org
Tue Apr 4 01:50:07 UTC 2023
On Mon, 27 Mar 2023 08:04:23 GMT, Afshin Zafari <duke at openjdk.org> wrote:
> `os::write` is called in a loop until all the requested size is written. The number of bytes parameter(`size_t nbytes`) is casted to `ssize_t size` to be able to check `> 0` condition. To enable pointer arithmetic, the `const void *` is casted to `const char *` for addition and then recasted back.
>
> ### Test
> local: hotspot:tier1
> mach5 tier1-5
I'd just like to point out that `os::write` is just our wrapper around the platform `write` method and it is the underlying method that can fail to write the full amount. If we want some additional utility methods to `write_fully` then that is fine, but not sure they really belong in `os::` namespace, nor is it what `os::write` itself should provide.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/13188#issuecomment-1495223077
More information about the hotspot-runtime-dev
mailing list