Skip to content

Commit

Permalink
{linux,bsd}-user: Update ts_tid after fork()
Browse files Browse the repository at this point in the history
Currently ts_tid contains the parent tid after fork(), which is not
correct. So far it has not affected anything, but the upcoming
follow-fork-mode child support relies on the correct value, so fix it.

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
Reviewed-by: Warner Losh <imp@bsdimp.com>
Message-Id: <20240219141628.246823-4-iii@linux.ibm.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20240305121005.3528075-5-alex.bennee@linaro.org>
  • Loading branch information
iii-i authored and stsquad committed Mar 6, 2024
1 parent e4e5cb4 commit d4e1369
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions bsd-user/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ void fork_end(int child)
* state, so we don't need to end_exclusive() here.
*/
qemu_init_cpu_list();
get_task_state(thread_cpu)->ts_tid = qemu_get_thread_id();
gdbserver_fork(thread_cpu);
} else {
mmap_fork_end(child);
Expand Down
1 change: 1 addition & 0 deletions linux-user/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ void fork_end(int child)
}
}
qemu_init_cpu_list();
get_task_state(thread_cpu)->ts_tid = qemu_get_thread_id();
gdbserver_fork(thread_cpu);
} else {
cpu_list_unlock();
Expand Down

0 comments on commit d4e1369

Please sign in to comment.