On 10/17/2014 02:51 PM, Michael Kerrisk (man-pages) wrote: > [CC expanded, just in case Carlos and Alexandre have something > to add] > > On 10/17/2014 08:29 AM, Peng Haitao wrote: >> >> On 10/17/2014 02:05 PM, Michael Kerrisk (man-pages) wrote: >>> Hello Haitao, >>> >>> Just double checking one point. See below. >>> >>> On 10/17/2014 05:59 AM, Peng Haitao wrote: >>>> Signed-off-by: Peng Haitao <penght@xxxxxxxxxxxxxx> >>>> --- >>>> man3/getlogin.3 | 24 ++++++++++++++---------- >>>> 1 file changed, 14 insertions(+), 10 deletions(-) >>>> >>>> diff --git a/man3/getlogin.3 b/man3/getlogin.3 >>>> index fcbd0fb..828df2b 100644 >>>> --- a/man3/getlogin.3 >>>> +++ b/man3/getlogin.3 >>>> @@ -138,19 +138,23 @@ password database file >>>> (traditionally \fI/etc/utmp\fP; >>>> some libc versions used \fI/var/adm/utmp\fP) >>>> .SH ATTRIBUTES >>>> -.SS Multithreading (see pthreads(7)) >>>> -The >>>> +For an explanation of the terms used in this section, see >>>> +.BR attributes (7). >>>> +.TS >>>> +allbox; >>>> +lb lb lb >>>> +l l l. >>>> +Interface Attribute Value >>>> +T{ >>>> .BR getlogin () >>>> -function is not thread-safe. >>>> -.LP >>>> -The >>>> +T} Thread safety MT-Unsafe locale >>> >>> Should this be "MT-Safe locale"? >>> >> >> getlogin() is MT-Unsafe and is influenced by setlocale(), >> So "MT-Unsafe locale" is right. > > Thank you for the confirmation. > > Just by the way, I see that the glibc manual says of getlogin: > > MT-Unsafe race:getlogin race:utent sig:ALRM timer locale > > I guess this covers some cases beyond what you document. Is that > correct? > Yes. I think "race:getlogin" result in MT-Unsafe. "race:getlogin" is equal to the sentences in manpage: getlogin() returns a pointer to a string containing ... The string is statically allocated and might be overwritten on subsequent calls to this function or to cuserid(). -- Best Regards, Peng > Thanks, > > Michael > -- To unsubscribe from this list: send the line "unsubscribe linux-man" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html