summary refs log tree commit diff stats
path: root/bsd-user/main.c
diff options
context:
space:
mode:
authorIlya Leoshkevich <iii@linux.ibm.com>2024-03-05 12:09:40 +0000
committerAlex Bennée <alex.bennee@linaro.org>2024-03-06 12:35:19 +0000
commitd4e1369abe67a4ffae2abbbd943aaeadc9595cc2 (patch)
tree9f964ccffb21fcccf1b188344c405a5c617372b9 /bsd-user/main.c
parente4e5cb4a54403558defb4669a8c64cbd67713e1e (diff)
downloadfocaccia-qemu-d4e1369abe67a4ffae2abbbd943aaeadc9595cc2.tar.gz
focaccia-qemu-d4e1369abe67a4ffae2abbbd943aaeadc9595cc2.zip
{linux,bsd}-user: Update ts_tid after fork()
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>
Diffstat (limited to 'bsd-user/main.c')
-rw-r--r--bsd-user/main.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/bsd-user/main.c b/bsd-user/main.c
index 512d4ab69f..e39eef3040 100644
--- a/bsd-user/main.c
+++ b/bsd-user/main.c
@@ -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);