8161360: Deprecated vfork() should not be used on Solaris

Reviewed-by: rriggs, dsamersoff
This commit is contained in:
Alan Burlison 2016-09-06 13:09:29 -04:00
parent 0f792063c1
commit 3228ea809c

View File

@ -349,6 +349,8 @@ static int copystrings(char *buf, int offset, const char * const *arg) {
__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 @@ vforkChild(ChildStuff *c) {
assert(resultPid != 0); /* childProcess never returns */
return resultPid;
}
#endif
static pid_t
forkChild(ChildStuff *c) {
@ -479,8 +482,11 @@ spawnChild(JNIEnv *env, jobject process, ChildStuff *c, const char *helperpath)
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)