View Issue Details

IDProjectCategoryView StatusLast Update
00005691003.1(2008)/Issue 7System Interfacespublic2019-06-10 08:55
Reportergeoffclare Assigned Toajosey  
PrioritynormalSeverityObjectionTypeOmission
Status ClosedResolutionAccepted As Marked 
NameGeoff Clare
OrganizationThe Open Group
User Reference
Sectiongetdelim
Page Number1005
Line Number33740
Interp StatusApproved
Final Accepted TextSee 0000569:0001244
Summary0000569: Two omissions in the getdelim() description
DescriptionThe getdelim() description omits any mention that it updates *n to the
new size when it increases the size of *lineptr.

Also, it doesn't say that if *lineptr is null, getdelim() allocates
a buffer and sets *lineptr to point to it, and sets *n to its size.

It is clear from the example code that both of these are expected
behaviours.

The proposed changes also correct a use of "line" where the delimiter
need not be newline, and a use of "characters" in the RETURN VALUE
section that should be "bytes".
Desired ActionChange:

    The size of the object pointed to by *lineptr shall be increased
    to fit the incoming line, if it isn't already large enough,
    including room for the delimiter and a terminating NUL. The
    characters read, including any delimiter, shall be stored in the
    string pointed to by the lineptr argument, and a terminating NUL
    added when the delimiter or end of file is encountered.

to:

    If *lineptr is a null pointer or if the object pointed to by
    *lineptr is of insufficient size, an object shall be allocated
    as if by malloc() or the object shall be reallocated as if by
    realloc(), respectively, such that the object is large enough to
    hold the characters to be written to it, including the terminating
    NUL, and *n shall be set to the new size. If the object was
    allocated, or if the reallocation operation moved the object,
    *lineptr shall be updated to point to the new object or new
    location. The characters read, including any delimiter, shall be
    stored in the object, and a terminating NUL added when the
    delimiter or end of file is encountered.

At line 33751 change:

    shall return the number of characters written

to:

    shall return the number of bytes written
Tagstc2-2008

Activities

Don Cragun

2012-05-31 15:32

manager   bugnote:0001244

Interpretation response
------------------------
The standard does not speak to this issue, and as such no conformance distinction can be made between alternative implementations based on this. This is being referred to the sponsor.

Rationale:
-------------
We believe that the changes described here already match existing practice and describe what was originally intended.

Notes to the Editor (not part of this interpretation):
-------------------------------------------------------
Make the changes suggested in the Desired Action.

ajosey

2012-06-29 16:15

manager   bugnote:0001287

Interpretation proposed 29 June 2012 for final 45 day review

ajosey

2012-08-30 09:13

manager   bugnote:0001350

Interpretation approved 30 Aug 2012

Issue History

Date Modified Username Field Change
2012-05-28 16:09 geoffclare New Issue
2012-05-28 16:09 geoffclare Status New => Under Review
2012-05-28 16:09 geoffclare Assigned To => ajosey
2012-05-28 16:09 geoffclare Name => Geoff Clare
2012-05-28 16:09 geoffclare Organization => The Open Group
2012-05-28 16:09 geoffclare Section => getdelim
2012-05-28 16:09 geoffclare Page Number => 1005
2012-05-28 16:09 geoffclare Line Number => 33740
2012-05-28 16:09 geoffclare Interp Status => ---
2012-05-31 15:32 Don Cragun Interp Status --- => Pending
2012-05-31 15:32 Don Cragun Note Added: 0001244
2012-05-31 15:32 Don Cragun Status Under Review => Interpretation Required
2012-05-31 15:32 Don Cragun Resolution Open => Accepted As Marked
2012-05-31 15:32 Don Cragun Tag Attached: tc2-2008
2012-05-31 15:33 Don Cragun Final Accepted Text => See 0000569:0001244
2012-06-29 16:15 ajosey Interp Status Pending => Proposed
2012-06-29 16:15 ajosey Note Added: 0001287
2012-08-30 09:13 ajosey Interp Status Proposed => Approved
2012-08-30 09:13 ajosey Note Added: 0001350
2019-06-10 08:55 agadmin Status Interpretation Required => Closed