--- old/src/jdk.net/macosx/native/libextnet/MacOSXSocketOptions.c 2020-08-26 14:45:27.000000000 +0100 +++ new/src/jdk.net/macosx/native/libextnet/MacOSXSocketOptions.c 2020-08-26 14:45:27.000000000 +0100 @@ -23,6 +23,7 @@ * questions. */ #include +#include #include #include #include @@ -125,6 +126,23 @@ /* * Class: jdk_net_MacOSXSocketOptions + * Method: getSoPeerCred0 + * Signature: (I[I)I + */ +JNIEXPORT void JNICALL Java_jdk_net_MacOSXSocketOptions_getSoPeerCred0 + (JNIEnv *env, jclass clazz, jint fd, jintArray result) { + + int *rr = (int *)(*env)->GetIntArrayElements(env, result, NULL); + + jint rv; + rv = getpeereid(fd, (uid_t *)&rr[0], (gid_t *)&rr[1]); + (*env)->ReleaseIntArrayElements(env, result, rr, 0); + handleError(env, rv, "get peer eid failed"); +} + + +/* + * Class: jdk_net_MacOSXSocketOptions * Method: getTcpKeepAliveTime0 * Signature: (I)I; */