Making __clone3() public
Florian Weimer
fweimer@redhat.com
Fri May 16 08:21:50 GMT 2025
* Yury Khrustalev via Libc-help:
> I'd like to write a test for Glibc that would use the __clone3() wrapper.
>
> Currently, this symbol is local in libc.so and cannot be used in an app.
> I need to call the existing wrapper instead of writing my own because I
> need to test a change in the existing one.
>
> What would be the best way to achieve this. If making this symbol public
> is OK, how should I do this? I supposes there should be a way to expose
> it via the table in libc.map but I couldn't find a way to do it.
There are many different shapes a clone3 wrapper could take:
fork (runs fork handlers)
_Fork (does not run fork handlers)
vfork (does not run fork handlers, pauses original thread)
__clone2 (does not run fork handlers, uses callback and separate stack)
pthread_create (does not run fork handlers, callback & stack &TCB)
So it's probably not going to be a single wrapper.
Thanks,
Florian
More information about the Libc-help
mailing list