8339487: ProcessHandleImpl os_getChildren sysctl call - retry in case of ENOMEM and enhance exception message

Reviewed-by: alanb, lucy, rriggs
This commit is contained in:
Matthias Baesken 2024-09-09 07:35:18 +00:00
parent cb5c60b530
commit 4ff72dc57e
2 changed files with 28 additions and 18 deletions

View file

@ -528,7 +528,7 @@ jint unix_getChildren(JNIEnv *env, jlong jpid, jlongArray jarray,
* position integer as a filename.
*/
if ((dir = opendir("/proc")) == NULL) {
JNU_ThrowByNameWithLastError(env,
JNU_ThrowByNameWithMessageAndLastError(env,
"java/lang/RuntimeException", "Unable to open /proc");
return -1;
}