View Issue Details

IDProjectCategoryView StatusLast Update
00008261003.1(2013)/Issue7+TC1System Interfacespublic2019-06-10 08:54
Reportergeoffclare Assigned To 
PrioritynormalSeverityObjectionTypeOmission
Status ClosedResolutionAccepted 
NameGeoff Clare
OrganizationThe Open Group
User Reference
Section2.9.1
Page Number512
Line Number17626
Interp Status---
Final Accepted Text
Summary0000826: setlocale() should not be required to be thread-safe
DescriptionSince setlocale() is one of the functions that returns internal
data that can be overwritten by a subsequent call, it should have
been included in the list of functions that need not be thread-safe,
along with all the other such functions, when threads were first
added to POSIX, but somehow it was omitted.

It's possible that some implementations are using a per-thread
internal buffer in order to make setlocale() thread-safe, but C11
does not require this (it says "A call to the setlocale function may
introduce a data race with other calls to the setlocale function"),
so POSIX should not require it either.

Also, since setlocale() is not in the list in 2.9.1 it was overlooked
by 0000656. Rather than reopen that bug to add it, the relevant
change is included here.
Desired ActionAt page 512 line 17626 section 2.9.1 add setlocale() to the list of
functions that need not be thread-safe.

At page 1884 line 60595 section setlocale() add a new paragraph to
the end of the DESCRIPTION:

    [CX]The setlocale() function need not be thread-safe.[/CX]

At page 1884 line 60604 section setlocale() after:

    [CX]The returned string pointer might be invalidated or[/CX] the
    string content might be overwritten by a subsequent call to
    setlocale().

add:

    [CX]The returned pointer might also be invalidated if the calling
    thread is terminated.[/CX]
Tagstc2-2008

Relationships

related to 0000656 Closedajosey Clearly allow or forbid thread-local storage for "static" buffers 

Activities

There are no notes attached to this issue.

Issue History

Date Modified Username Field Change
2014-02-12 15:07 geoffclare New Issue
2014-02-12 15:07 geoffclare Name => Geoff Clare
2014-02-12 15:07 geoffclare Organization => The Open Group
2014-02-12 15:07 geoffclare Section => 2.9.1
2014-02-12 15:07 geoffclare Page Number => 512
2014-02-12 15:07 geoffclare Line Number => 17626
2014-02-12 15:07 geoffclare Interp Status => ---
2014-02-12 15:07 geoffclare Relationship added related to 0000656
2014-03-20 15:50 Don Cragun Status New => Resolved
2014-03-20 15:50 Don Cragun Resolution Open => Accepted
2014-03-20 15:51 Don Cragun Tag Attached: tc2-2008
2019-06-10 08:54 agadmin Status Resolved => Closed