Making __clone3() public

Yury Khrustalev yury.khrustalev@arm.com
Thu May 22 11:56:16 GMT 2025


On Thu, May 15, 2025 at 06:32:51PM -0400, Carlos O'Donell wrote:
> On 5/15/25 10:04 AM, Yury Khrustalev via Libc-help wrote:
> > I'd like to write a test for Glibc that would use the __clone3() wrapper.
> 
> There isn't an easy way AFAIK.
> > Currently, this symbol is local in libc.so and cannot be used in an app.
> 
> Correct, and you might be able to write a test that links against
> clone-internal.os to cobble together what you need, but it would be a test
> with a distinct copy of __clone3() (though identical).
> 
> See tst-_dl_addr_inside_object for an example?

I'm not sure about tst-_dl_addr_inside_object but I managed to achieve what
I want by liking my test with clone3.o and providing some stubs for its
dependencies.

See https://patchwork.sourceware.org/project/glibc/list/?series=47709

> ...
>
> So you would have to work out the details of a safe clone3 wrapper.

Yeah, this use case doesn't seem to be worth it.

Thanks,
Yury



More information about the Libc-help mailing list