changeset 15575:021369229cfd jdk-9+135

8161360: Deprecated vfork() should not be used on Solaris Reviewed-by: rriggs, dsamersoff
author alanbur
date Tue, 06 Sep 2016 13:09:29 -0400
parents c320f2d8b078
children 02d65bf86352 7c15548ab9d6
files src/java.base/unix/native/libjava/ProcessImpl_md.c
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/java.base/unix/native/libjava/ProcessImpl_md.c	Tue Sep 06 18:16:56 2016 +0530
+++ b/src/java.base/unix/native/libjava/ProcessImpl_md.c	Tue Sep 06 13:09:29 2016 -0400
@@ -349,6 +349,8 @@
 __attribute_noinline__
 #endif
 
+/* vfork(2) is deprecated on Solaris */
+#ifndef __solaris__
 static pid_t
 vforkChild(ChildStuff *c) {
     volatile pid_t resultPid;
@@ -367,6 +369,7 @@
     assert(resultPid != 0);  /* childProcess never returns */
     return resultPid;
 }
+#endif
 
 static pid_t
 forkChild(ChildStuff *c) {
@@ -479,8 +482,11 @@
 static pid_t
 startChild(JNIEnv *env, jobject process, ChildStuff *c, const char *helperpath) {
     switch (c->mode) {
+/* vfork(2) is deprecated on Solaris */
+#ifndef __solaris__
       case MODE_VFORK:
         return vforkChild(c);
+#endif
       case MODE_FORK:
         return forkChild(c);
 #if defined(__solaris__) || defined(_ALLBSD_SOURCE) || defined(_AIX)