|Anonymous | Login||2022-01-17 22:56 UTC|
|Main | My View | View Issues | Change Log | Docs|
|Viewing Issue Simple Details|
|ID||Category||Severity||Type||Date Submitted||Last Update|
|0001027||[1003.1(2013)/Issue7+TC1] System Interfaces||Objection||Error||2016-02-17 10:16||2020-04-14 15:07|
|Priority||high||Resolution||Accepted As Marked|
|Organization||The Open Group|
|Page Number||946, 965|
|Line Number||31911, 32581|
|Final Accepted Text||See Note: 0003109|
|Summary||0001027: file-position indicator for open_wmemstream() streams|
The descriptions of fseek() and ftell() say that the file-position
indicator is "measured in bytes from the beginning of the file".
However, for streams opened with open_wmemstream() it is supposed
to measure the number of wide characters, not the number of bytes.
(This is how glibc behaves, and the standard's requirements for the
behaviour of open_wmemstream() when it was added in SUSv4 were intended
to match glibc.)
On Page: 946 Line: 31911 Section: fseek()
The new position, measured in bytes from the beginning of the file, shallto:
The new position, measured in bytes from the beginning of the file, [CX]except in the case of streams opened with open_wmemstream() for which the position is measured in wide characters,[/CX] shall
On Page: 965 Line: 32581 Section: ftell()
measured in bytes from the beginning of the fileto:
measured in bytes from the beginning of the file, [CX]except in the case of streams opened with open_wmemstream() for which the position is measured in wide characters.[/CX]
On Page: 947 Line: 31981 Section: fseek()
and Page: 965 Line: 32600 Section: ftell()
Add open_wmemstream to the SEE ALSO section.
The standard states that ftell() and fseek() operate on byte offsets with streams opened by open_wmemstream(), and conforming implementations must conform to this. However, concerns have been raised about this which are being referred to the sponsor.
The standard originally attempted to specify glibc's behavior, but an unintentional error was made resulting in a specification that did not match the glibc behavior.
Notes to the Editor (not part of this interpretation):
Make the changes in the Desired Action. In addition, make the following changes:
On page 965 line 32596 (ftell() RATIONALE), change "None" to the following new paragraph:
For all streams other than those opened by open_wmemstream(), ftell() and fseek() operate on byte offsets. The behavior with open_wmemstream() streams is intentionally different—ftell() and fseek() operate on wide character offsets. This is because those streams are unique in that the backing storage is not a multibyte representation but a wide character array, and it is useful to be able to use the output of ftell() to index into that array.
On page 947 line 31977 (fseek() RATIONALE), change "None" to:
See the rationale for ftell().
|Interpretation proposed: March 25 2016|
|Interpretation Approved: 30 April 2016|
|2016-02-17 10:16||geoffclare||New Issue|
|2016-02-17 10:16||geoffclare||Name||=> Geoff Clare|
|2016-02-17 10:16||geoffclare||Organization||=> The Open Group|
|2016-02-17 10:16||geoffclare||Section||=> fseek, ftell|
|2016-02-17 10:16||geoffclare||Page Number||=> 946, 965|
|2016-02-17 10:16||geoffclare||Line Number||=> 31911, 32581|
|2016-02-17 10:16||geoffclare||Interp Status||=> ---|
|2016-03-24 16:21||rhansen||Note Added: 0003109|
|2016-03-24 16:21||rhansen||Tag Attached: issue8|
|2016-03-24 16:22||rhansen||Interp Status||--- => Pending|
|2016-03-24 16:22||rhansen||Final Accepted Text||=> See Note: 0003109|
|2016-03-24 16:22||rhansen||Status||New => Interpretation Required|
|2016-03-24 16:22||rhansen||Resolution||Open => Accepted As Marked|
|2016-03-25 17:08||ajosey||Interp Status||Pending => Proposed|
|2016-03-25 17:08||ajosey||Note Added: 0003111|
|2016-04-30 05:18||ajosey||Interp Status||Proposed => Approved|
|2016-04-30 05:18||ajosey||Note Added: 0003188|
|2020-04-14 15:07||geoffclare||Status||Interpretation Required => Applied|
|Mantis 1.1.6[^] Copyright © 2000 - 2008 Mantis Group|