RFR: JDK-8262955: Unify os::fork_and_exec() across Posix platforms [v3]
Thomas Stuefe
stuefe at openjdk.java.net
Mon Mar 8 06:07:07 UTC 2021
On Mon, 8 Mar 2021 05:24:36 GMT, David Holmes <dholmes at openjdk.org> wrote:
>> Thomas Stuefe has updated the pull request incrementally with one additional commit since the last revision:
>>
>> tidy up
>
> src/hotspot/share/utilities/macros.hpp line 439:
>
>> 437: #endif
>> 438: #define POSIX_ONLY(code) code
>> 439: #define NOT_POSIX(code)
>
> Not sure this makes sense. At the moment only Windows is not-POSIX. If in the future we had another non-POSIX platform then I find it very unlikely that it would use the same code as Windows. So I would not like to see NOT_POSIX used incorrectly where we really only mean WINDOWS.
My intention was exactly that, using it to protect *Posix* code from compiling on non-Posix platforms. Using !Windows there is just as wrong and not as descriptive. Most !Windows cases in hotspot are not affected by this since they have nothing to do with Posix; but there are a few and there may be more. E.g. I am currently working on a patch to protect the program break on Unices. This means dealing with sbrk, and depending on which route I go a POSIX_ONLY macro would make perfect sense.
That POSIX is defined as !Windows is only incidental. If you prefer, I can list the posix operating systems here; I did not do that for brevity.
-------------
PR: https://git.openjdk.java.net/jdk/pull/2810
More information about the hotspot-dev
mailing list