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

Daniel D. Daugherty daniel.daugherty at oracle.com
Mon Jul 11 15:02:32 UTC 2016


On 7/11/16 7:22 AM, Alan Burlison wrote:
> Hi, I'd like to ask for reviews for:
>
> JDK-8160997 Solaris: deprecated <pwd.h> and <gid.h> interfaces should 
> be replaced
>
> This is to remove code that was a workaround that was needed for 
> Solaris 2.4. In 2.4 we implemented interfaces from the draft of 
> POSIX.1c Draft 6 which then changed in the final POSIX release, and we 
> were then stuck with the warts.
>
> For Solaris 11, defining the macro _POSIX_PTHREAD_SEMANTICS enables 
> the 'official' POSIX information and means that the code which works 
> on Linux etc also works the same on Solaris, so the Solaris-specific 
> workarounds can be removed.
>
> Bug:
> https://bugs.openjdk.java.net/browse/JDK-8160997
>
> Webrev:
> http://cr.openjdk.java.net/~dcubed/for_alanbur/8160997-webrev/0-jdk9-hs-all/ 
>

hotspot/src/os/solaris/vm/os_solaris.cpp
     No comments.

hotspot/src/os/solaris/vm/perfMemory_solaris.cpp
     No comments.

hotspot/src/os_cpu/solaris_sparc/vm/os_solaris_sparc.cpp
     No comments.

hotspot/src/os_cpu/solaris_x86/vm/os_solaris_x86.cpp
     No comments.

jdk/src/java.base/unix/native/libjava/ProcessHandleImpl_unix.c
     No comments.

jdk/src/java.base/unix/native/libnio/fs/UnixNativeDispatcher.c
     No comments.

jdk/src/jdk.security.auth/solaris/native/libjaas/Solaris.c
     So you added the &p parameter to the getpwuid_r(), but
     then you never check or use the returned 'p'.

     Other places that had both Solaris and non-Solaris variants
     had code like this:

     L479:         if (result == 0 && p != NULL &&
     L480:             p->pw_name != NULL && *(p->pw_name) != '\0') {
     L481:             name = JNU_NewStringPlatform(env, p->pw_name);
     L482:         }

     Of course, this Solaris specific code checked the returned
     '&pwd' value because it didn't have an &p parameter. I don't
     this is a problem, especially since I don't understand why
     this function has both an '&pwd' param and an '&p' param,
     but I figured I would raise the question.

jdk/src/jdk.security.auth/unix/native/libjaas/Unix.c
     No comments.

Thumbs up! I don't know what to think of the libjaas/Solaris.c
code not using the possibly duplicate '&p' param.


>
> JPRT + the hotspot testset was clean.
>

If I remember correctly, you also ran a regular JPRT test job
(without -testset hotspot). I believe that the regular job
runs JDK focused testing, but I'd have to look at the JPRT
job to be sure.

Dan



More information about the hotspot-runtime-dev mailing list