mirror of
https://github.com/apache/nuttx.git
synced 2026-10-07 22:35:22 +00:00
exec() swaps the pids of the caller and the new task, so that the new program keeps the pid of the caller. exec_swap() changes tcb->pid and group->tg_pid. But getpid() and gettid() read the copies in TLS, tg_info->ta_pid and tl_tid, and exec_swap() does not change them. So getpid() in the new program returns the pid that the caller has now, and kill(getpid(), sig) sends the signal to the caller. Make exec_swap() update both copies for both tasks. The address environment of the new task is current in exec_swap(). The TLS of the caller is in the address environment of the caller, so exec_swap() selects that environment for the update of the caller. Assisted-by: Claude Code:claude-opus-5-5 Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com> |
||
|---|---|---|
| .. | ||
| libnxflat | ||
| binfmt.h | ||
| binfmt_checkexec.c | ||
| binfmt_copyactions.c | ||
| binfmt_copyargv.c | ||
| binfmt_dumpmodule.c | ||
| binfmt_exec.c | ||
| binfmt_execmodule.c | ||
| binfmt_execsymtab.c | ||
| binfmt_exit.c | ||
| binfmt_globals.c | ||
| binfmt_initialize.c | ||
| binfmt_loadmodule.c | ||
| binfmt_register.c | ||
| binfmt_unloadmodule.c | ||
| binfmt_unregister.c | ||
| builtin.c | ||
| CMakeLists.txt | ||
| elf.c | ||
| Kconfig | ||
| Makefile | ||
| nxflat.c | ||