[PATCH] clone.2: note EINVAL when exit_signal + bad flags

Jack Pearson jack@pearson.onl
Wed Dec 14 21:13:33 GMT 2022


Will do. I'm still learning the etiquette for developing over mailing 
list. Trying not to fill up peoples' inboxes with junk y'know.

Thanks,

Jack

On 12/14/22 13:02, Alejandro Colomar wrote:
> Hi Jack,
> 
> Please keep glibc and Carlos in the loop.
> 
> Thanks,
> 
> Alex
> 
> On 12/14/22 22:00, Jack Pearson wrote:
>> On 12/12/22 18:53, Carlos O'Donell wrote:
>>> On 12/9/22 14:49, Alejandro Colomar wrote:
>>>> Hi Jack,
>>>>
>>>> On 12/2/22 23:44, Jack Pearson wrote:
>>>>> Document that Linux will report EINVAL when exit_signal is 
>>>>> specified and
>>>>> either CLONE_THREAD or CLONE_PARENT is specified.
>>>>>
>>>>>   From clone3_args_valid in Linux:
>>>>> ```
>>>>>      if ((kargs->flags & (CLONE_THREAD | CLONE_PARENT)) &&
>>>>>          kargs->exit_signal)
>>>>>          return false;
>>>>> ```
>>>>>
>>>>> I have verified that this happens on my kernel with a small 
>>>>> program, and
>>>>> that this doesn't happen with normal `clone` through the glibc helper.
>>>>
>>>> Could you please also send a test program with the glibc wrapper?
>>>>
>>>> BTW, glibc has a clone3(2) wrapper since last year.  It would be 
>>>> interesting to document it instead of the raw syscall.
>>>
>>> glibc does not have a clone3 wrapper.
>>>
>>> glibc has an internal non-exported __clone3 interface that we use for 
>>> pthreads,
>>> and likely soon for posix_spawn.
>>>
>>> We have not yet chosen to export clone3 as a public global symbol 
>>> that developers
>>> can use.
>>>
>>
>> Ahhh, that's why I couldn't find it in the headers.
>>
>> Incoming patch with the glibc clone wrapper test program.
>>
>>
>> Jack
> 


More information about the Libc-alpha mailing list