[PATCH] manual: Document setlogmask as MT-safe.

Carlos O'Donell carlos@redhat.com
Thu Feb 20 13:06:37 GMT 2025


On 2/20/25 3:23 AM, Florian Weimer wrote:
> * Carlos O'Donell:
> 
>> On 2/13/25 4:04 PM, Florian Weimer wrote:
>>> * Carlos O'Donell:
>>>
>>>> setlogmask(3) was made MT-safe in glibc-2.33 with the fix for
>>>> bug 26100.
>>>> ---
>>>>  manual/syslog.texi | 5 +----
>>>>  1 file changed, 1 insertion(+), 4 deletions(-)
>>>>
>>>> diff --git a/manual/syslog.texi b/manual/syslog.texi
>>>> index 02f84d6e6f..90a6487c02 100644
>>>> --- a/manual/syslog.texi
>>>> +++ b/manual/syslog.texi
>>>> @@ -498,10 +498,7 @@ The symbols referred to in this section are declared in the file
>>>>  
>>>>  @deftypefun int setlogmask (int @var{mask})
>>>>  @standards{BSD, syslog.h}
>>>> -@safety{@prelim{}@mtunsafe{@mtasurace{:LogMask}}@asunsafe{}@acsafe{}}
>>>> -@c Read and modify are not guarded by syslog_lock, so concurrent changes
>>>> -@c or even uses are undefined.  This should use an atomic swap instead,
>>>> -@c at least for modifications.
>>>> +@safety{@prelim{}@mtsafe{}@asunsafe{}@acsafe{}}
>>>>  
>>>>  @code{setlogmask} sets a mask (the ``logmask'') that determines which
>>>>  future @code{syslog} calls shall be ignored.  If a program has not
>>>
>>> Looks good.
>>>
>>> Reviewed-by: Florian Weimer <fweimer@redhat.com>
>>
>> And surprising this broke check-safety.sh test.
>>
>> I think it is a flaw in the test that it passes before but doesn't pass now.
> 
> I think it's deliberate that @asunsafe always requires an argument.
> 

Sorry, let me clarify.

I didn't change "@asunsafe{}" and it didn't fail before.

The defect is that check-type.sh did not previously fail, but failed when I
transitioned mtunsafe to mtsafe.

This is probably a regex problem in check-safety.sh, and I'll fix it in a
distinct patch.

-- 
Cheers,
Carlos.



More information about the Libc-alpha mailing list