Making __clone3() public
Florian Weimer
fweimer@redhat.com
Mon May 19 09:53:50 GMT 2025
* Yury Khrustalev:
> On Fri, May 16, 2025 at 10:21:50AM +0200, Florian Weimer wrote:
>> * Yury Khrustalev via Libc-help:
>>
>> > I'd like to write a test for Glibc that would use the __clone3() wrapper.
>>
>> 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.
>
> I meant calling the __clone3() symbol directly, not using one of these wrappers.
> I'll try the solution proposed by Carlos in the adjacent reply.
I think we should cover relevant use cases with the new interfaces.
Right now, quite a few users of the __clone2 interface longjmp out of
the callback function, or they override the TID in the TCB like we do in
fork. The new interfaces we add should not require this.
Thanks,
Florian
More information about the Libc-help
mailing list