RFR: JDK-8160997 Solaris: deprecated <pwd.h> and <gid.h> interfaces should be replaced

Alan Burlison Alan.Burlison at oracle.com
Thu Jul 14 07:52:53 UTC 2016


On 14/07/2016 02:20, David Holmes wrote:

> One query: if pwd.h is not the last file included don't we need to undef
>   _POSIX_PTHREAD_SEMANTICS again to ensure no other included definitions
> are affected? If we don't need to do that then I wonder whether
> _POSIX_PTHREAD_SEMANTICS should not simply be set via the build system
> for all compilations?

_POSIX_PTHREAD_SEMANTICS only affects a few APIs which changed between 
POSIX.1c Draft 6 and POSIX 1003.1c - Solaris implemented the draft 
version due to release scheduling issues, which was a mistake. Some of 
the differences don't matter for LP64 apps such as Java, the other APIs 
are less-frequently used. The main problems you tend to see are the 
user/group iteration APIs (as in this case) and directory enumeration. 
You could undef _POSIX_PTHREAD_SEMANTICS if you wanted but there's no 
real benefit and it would add yet more clutter.

As for setting it globally, no that wouldn't be a good idea. It's a 
workaround for a problem that will be gone in later Solaris releases, 
where you'll get the POSIX 1003.1c definitions by default and will have 
to explicitly ask for the old draft ones. At that point defining 
_POSIX_PTHREAD_SEMANTICS will have no effect. It is a transitional 
workaround for a misfeature and as such I believe needs to be restricted 
as much as possible by just adding it to the affected files, and then 
removing it altogether as soon as possible.

-- 
Alan Burlison
--


More information about the hotspot-runtime-dev mailing list