[PATCH] htl: move remnant of pthread_atfork into libc.

Samuel Thibault samuel.thibault@aquilenet.fr
Thu Nov 20 22:35:29 GMT 2025


Hello,

gfleury, le jeu. 20 nov. 2025 11:06:12 +0200, a ecrit:
> According to sysdeps/htl/pthread_atfork_compat.h, pthread_atfork was introduced in GLIBC_2_12, so move it there.

Yes.

> No other changes were introduced, as it is in nptl.

Yes, because it's just a compatibility symbols, newly-compiled
programs won't be using it. See which is the current pthread_atfork
implementation, and libc.so which is actually a link script to link
libcrt_nonshared.a into the program/library itself, and emit a ref
to __register_atfork (the goal is to pass the __dso_handle of the
program/library)

> Is it okay that it is not in x86_64?

Yes, x86_64 was introduced after the move to the new implementation, so
no need for the old pthread_atfork symbol there, only __register_atfork
is needed.

I have pushed the patch which I had prepared. With that, we have
migrated all pthread symbols, thanks so much for your work!

Now we can work on the c11 thread functions. We should probably move
them all in one go, to be able to just introduce a header similar to
./sysdeps/{htl,nptl}/pthread_atfork_compat.h to just replace GLIBC_2_34
with a macro.

And we'll also have the gai and aio/lio/timer/mq functions.

Samuel


More information about the Libc-alpha mailing list