]> git.ipfire.org Git - thirdparty/glibc.git/commit
hurd: Fix x86_64 _hurd_tls_fork
authorSergey Bugaev <bugaevc@gmail.com>
Wed, 17 May 2023 19:14:33 +0000 (22:14 +0300)
committerSamuel Thibault <samuel.thibault@ens-lyon.org>
Wed, 17 May 2023 21:00:59 +0000 (23:00 +0200)
commit2f8ecb58a59eb82c43214d000842d99644a662d1
tree72e11c22d8ce150bb4a58583b9e46f57c4036789
parentc7fcce38c83a2bb665ef5dc4981bf20c7e586123
hurd: Fix x86_64 _hurd_tls_fork

It is illegal to call thread_get_state () on mach_thread_self (), so
this codepath cannot be used as-is to fork the calling thread's TLS.
Fortunately we can use THREAD_SELF (aka %fs:0x0) to find out the value
of our fs_base without calling into the kernel.

Fixes: f6cf701efc61c9ad910372bda14b9a235db310a8
"hurd: Implement TLS for x86_64"

Checked on x86_64-gnu: fork () now works!

Signed-off-by: Sergey Bugaev <bugaevc@gmail.com>
Message-Id: <20230517191436.73636-8-bugaevc@gmail.com>
sysdeps/mach/hurd/x86_64/tls.h