Exec: Support run exec in current task

Fix the problem when vfork() calls execv() (or execl()) to start a new application:
When the parent thread calls vfork() it receives and gets the pid of the vforked task,
and not the pid of the desired execv'ed application.

issue #3334

Signed-off-by: yangyalei <yangyalei@xiaomi.com>
This commit is contained in:
yangyalei
2023-08-23 20:37:42 +08:00
committed by Xiang Xiao
parent 0d4b42255b
commit 670c245ff2
5 changed files with 154 additions and 10 deletions

View File

@@ -61,5 +61,7 @@ if(CONFIG_BUILTIN)
list(APPEND SRCS builtin.c)
endif()
target_include_directories(binfmt PRIVATE ${CMAKE_SOURCE_DIR}/sched)
target_sources(binfmt PRIVATE ${SRCS})
target_include_directories(binfmt PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})