--- 011-old/clone.c 2021-07-04 17:44:05.000000000 +0800 +++ 011/clone.c 2021-07-07 10:42:29.000000000 +0800 @@ -21,7 +21,7 @@ va_start(arg,child_stack); __asm__("int $0x80" :"=a" (res) - :"0" (__NR_open),"b" (fn),"c" (child_stack), + :"0" (__NR_clone),"b" (fn),"c" (child_stack), "d" (va_arg(arg,int))); if (res>=0) return res; @@ -36,7 +36,7 @@ static int child_func(void * arg){ g_shared = 1; printf(" Child says hello.\n"); - return 0; + exit(0); } void test_clone(void){