提交 6c4714c6 编写于 作者: S Shirong Hao 提交者: jia zhang

rune/libenclave/skeleton: Remove fork-test argument

Since the pal_create_process interface of PAI API v2 has achieved a similar function, fork-test argument is useless.
Signed-off-by: NShirong Hao <shirong@linux.alibaba.com>
上级 559d505f
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
#else #else
#include <sys/sysmacros.h> #include <sys/sysmacros.h>
#endif #endif
#include <sys/wait.h>
#include "defines.h" #include "defines.h"
#include "sgx_call.h" #include "sgx_call.h"
#include "liberpal-skeleton.h" #include "liberpal-skeleton.h"
...@@ -36,7 +35,6 @@ static struct sgx_secs secs; ...@@ -36,7 +35,6 @@ static struct sgx_secs secs;
static bool initialized = false; static bool initialized = false;
static char *sgx_dev_path; static char *sgx_dev_path;
static bool no_sgx_flc = false; static bool no_sgx_flc = false;
static bool fork_test = false;
static bool enclave_debug = true; static bool enclave_debug = true;
bool is_oot_driver; bool is_oot_driver;
/* /*
...@@ -377,8 +375,6 @@ static void check_opts(const char *opt) ...@@ -377,8 +375,6 @@ static void check_opts(const char *opt)
{ {
if (!strcmp(opt, "no-sgx-flc")) if (!strcmp(opt, "no-sgx-flc"))
no_sgx_flc = true; no_sgx_flc = true;
else if (!strcmp(opt, "fork-test"))
fork_test = true;
} }
static void parse_args(const char *args) static void parse_args(const char *args)
...@@ -450,25 +446,6 @@ int __pal_exec(char *path, char *argv[], pal_stdio_fds *stdio, int *exit_code) ...@@ -450,25 +446,6 @@ int __pal_exec(char *path, char *argv[], pal_stdio_fds *stdio, int *exit_code)
return -1; return -1;
} }
bool is_child = false;
if (fork_test) {
switch (fork()) {
case -1:
fprintf(fp, "fork(), errno = %d\n", errno);
fclose(fp);
return -1;
case 0:
fprintf(fp, "run in child process, pid = %d\n", (int)getpid());
is_child = true;
break;
default:
wait(NULL);
fprintf(fp, "run in parent process, pid = %d\n", (int)getpid());
break;
}
}
uint64_t result = 0; uint64_t result = 0;
int ret = SGX_ENTER_1_ARG(ECALL_MAGIC, (void *)secs.base, &result); int ret = SGX_ENTER_1_ARG(ECALL_MAGIC, (void *)secs.base, &result);
if (ret) { if (ret) {
...@@ -485,9 +462,6 @@ int __pal_exec(char *path, char *argv[], pal_stdio_fds *stdio, int *exit_code) ...@@ -485,9 +462,6 @@ int __pal_exec(char *path, char *argv[], pal_stdio_fds *stdio, int *exit_code)
fprintf(fp, "Enclave runtime skeleton initialization succeeded\n"); fprintf(fp, "Enclave runtime skeleton initialization succeeded\n");
fclose(fp); fclose(fp);
if (fork_test && is_child)
exit(0);
*exit_code = 0; *exit_code = 0;
return 0; return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册