RFR: JDK-8160997 Solaris: deprecated <pwd.h> and <gid.h> interfaces should be replaced
Alan Burlison
Alan.Burlison at oracle.com
Fri Jul 15 10:52:54 UTC 2016
On 15/07/2016 07:28, David Holmes wrote:
> Okay I looked further into the affect of this (I recalled we also use it
> in a test to deal with a sigwait API issue) and see that it changes the
> form of the function prototypes (and underlying implementation) so it
> won't silently change anything.
Yes, that's another one of the places it is used and for that and other
places it changes the APIs provided from the draft ones to the
standards-conforming ones. This is all the result of decision made back
in Solaris 2.4 that we are still living with, although it will be
addressed in future releases.
> Looking further into this aspect I can't help but feel we should be
> defining:
>
> _POSIX_C_SOURCE=200112L
>
> which would also fix the current problem and more generally make it
> clear we are intending to use specific standard-based API's. But that is
> going somewhat further than the scope of the current fix - and may run
> into unexpected consequences (we've been somewhat lax at programming to
> specific language and API versions).
Actually you almost certainly don't want that. Asking for a specific
POSIX version means exactly that, you'll get the APIs defined in that
version and nothing else. If you are using non-POSIX APIs, they will
disappear, because what you are asking for is an environment which all
conforming POSIX implementations will provide, i.e. lowest common
denominator. The implementation in the header files doesn't always match
up with that 100%, but that's theoretically how it should work.
My general advice would be to set the smallest possible number of most
restricted-scope feature macros that you can to get the behaviour you
want, which in this case is _POSIX_PTHREAD_SEMANTICS.
--
Alan Burlison
--
More information about the hotspot-runtime-dev
mailing list