On Sat, 27 Dec 2025 11:25:25 GMT, Harald Eilertsen <[email protected]> wrote:
> The Mac OSX implementation of the Serviceability Agent and related code is
> quite different from what's needed from the BSD implementation. Still we have
> tried to keep the coexisting in one codebase in the out-of-tree BSD port, as
> that's where the OSX code has been living.
>
> This sometimes cause problems when updates to the Mac OSX port breaks the BSD
> implementation.
>
> As we are working on getting the BSD port into a state for future upstreaming
> to the mainline repo, this patch clears the path by moving the Mac OSX
> implementation of the Servicability Agent to a more fitting namespace.
>
> This should allow us to proceed with the BSD implementation undisturbed, but
> also without risking breaking the OSX port.
>
> This work was sponsored by The FreeBSD Foundation
"darwin" seems to be mainly used within the SA code and it seems to be an alias
for macOS/macosx - though why it was done that way I'm unsure. May be uname has
"darwin" in it and so it is exposed via a system property? (Theoretically you
could have a different OS built upon the XNU - aka Darwin - kernel, but we are
not trying to support that in any way.
I also see this in java_props_md.c
ifdef MACOSX
/* darwin has a per-user temp dir */
static char tmp_path[PATH_MAX];
int pathSize = confstr(_CS_DARWIN_USER_TEMP_DIR, tmp_path, PATH_MAX);
if (pathSize > 0 && pathSize <= PATH_MAX) {
sprops.tmp_dir = tmp_path;
}
#endif /* MACOSX */
Regardless it makes no sense to have macOS and Darwin supported by SA so some
major renaming would also be needed there.
The macosx naming is legacy from the days of the mac port when it was known as
OS X. For a long time now it is just macOS but we didn't do a major renaming as
that would be too disruptive. But if we are creating new files here then we can
use the most appropriate naming scheme and not be caught up in legacy issues.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/29003#issuecomment-3716393460