From 6c4714c606b358f755560912b7e8dd5aa58ad7d1 Mon Sep 17 00:00:00 2001 From: Shirong Hao Date: Sun, 16 Aug 2020 15:26:19 +0000 Subject: [PATCH] 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: Shirong Hao --- .../runtime/pal/skeleton/liberpal-skeleton.c | 26 ------------------- 1 file changed, 26 deletions(-) diff --git a/rune/libenclave/internal/runtime/pal/skeleton/liberpal-skeleton.c b/rune/libenclave/internal/runtime/pal/skeleton/liberpal-skeleton.c index 3e83283..5856cbd 100644 --- a/rune/libenclave/internal/runtime/pal/skeleton/liberpal-skeleton.c +++ b/rune/libenclave/internal/runtime/pal/skeleton/liberpal-skeleton.c @@ -18,7 +18,6 @@ #else #include #endif -#include #include "defines.h" #include "sgx_call.h" #include "liberpal-skeleton.h" @@ -36,7 +35,6 @@ static struct sgx_secs secs; static bool initialized = false; static char *sgx_dev_path; static bool no_sgx_flc = false; -static bool fork_test = false; static bool enclave_debug = true; bool is_oot_driver; /* @@ -377,8 +375,6 @@ static void check_opts(const char *opt) { if (!strcmp(opt, "no-sgx-flc")) no_sgx_flc = true; - else if (!strcmp(opt, "fork-test")) - fork_test = true; } 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) 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; int ret = SGX_ENTER_1_ARG(ECALL_MAGIC, (void *)secs.base, &result); if (ret) { @@ -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"); fclose(fp); - if (fork_test && is_child) - exit(0); - *exit_code = 0; return 0; -- GitLab