RFR: JDK-8160997 Solaris: deprecated <pwd.h> and <gid.h> interfaces should be replaced
Alan Burlison
Alan.Burlison at oracle.com
Thu Jul 14 16:33:43 UTC 2016
On 14/07/2016 16:41, Daniel D. Daugherty wrote:
> If we #undef'ed it right after the one or two header files that we intend
> it to affect, then our intentions would be more clear. Yes, it will add
> one more line of "clutter", but I think clarity is more important.
I don't see how that makes intent any clearer when there's already a
comment that says exactly why it is being defined:
/* For POSIX-compliant getpwuid_r on Solaris */
#if defined(__solaris__)
#define _POSIX_PTHREAD_SEMANTICS
#endif
#include <pwd.h>
And if it is properly guarded, as it is when it is defined, it needs 3
lines, not 1. The guards aren't strictly necessary, so this would suffice:
/* For POSIX-compliant getpwuid_r on Solaris */
#define _POSIX_PTHREAD_SEMANTICS
#include <pwd.h>
#undef _POSIX_PTHREAD_SEMANTICS
Although I think this is verging on bikeshedding TBH.
> I also think this can be done as a pre-push change and does not need to
> go through yet another round of testing.
--
Alan Burlison
--
More information about the hotspot-runtime-dev
mailing list