Anonymous | Login | 2024-10-09 03:31 UTC |
Main | My View | View Issues | Change Log | Docs |
Viewing Issue Simple Details [ Jump to Notes ] | [ Issue History ] [ Print ] | ||||||
ID | Category | Severity | Type | Date Submitted | Last Update | ||
0001144 | [1003.1(2008)/Issue 7] System Interfaces | Editorial | Clarification Requested | 2017-06-14 14:31 | 2024-06-11 08:52 | ||
Reporter | Villemoes | View Status | public | ||||
Assigned To | ajosey | ||||||
Priority | normal | Resolution | Accepted As Marked | ||||
Status | Closed | ||||||
Name | Rasmus Villemoes | ||||||
Organization | |||||||
User Reference | |||||||
Section | fmemopen | ||||||
Page Number | |||||||
Line Number | |||||||
Interp Status | --- | ||||||
Final Accepted Text | Note: 0004169 | ||||||
Summary | 0001144: May fmemopen(buf, len, "r") modify the buffer | ||||||
Description |
If a memory stream is open in read-only mode, is the implementation allowed to modify the contents of the buffer? I can't find wording against that, but it would be rather odd if any implementation actually did it. If modifications are allowed, must they be restored when the stream is closed? (It should be obvious that fread() has to return the original contents, but nothing prevents the application from acccessing the buffer directly both while the stream exists and after it is closed.) It would be nice to be able to do parse_string(const char *s) { FILE *f = fmemopen((void*)s, strlen(s), "r") if (!f) err... parse_file(f); fclose(f); } without having to strdup() s, both for simplifying the code and for performance in case the string is huge. Conversely, is the application allowed to modify the buffer while the stream exists, and are modification required to be visible by a subsequent fread on the stream? |
||||||
Desired Action |
Clarify what an implementation is allowed to do with the buffer in case the stream is read-only. Clarify ownership rules and the effects of accessing the buffer directly while a stream exists using the same buffer. |
||||||
Tags | tc3-2008 | ||||||
Attached Files | |||||||
|
Relationships | ||||||
|
Issue History | |||
Date Modified | Username | Field | Change |
2017-06-14 14:31 | Villemoes | New Issue | |
2017-06-14 14:31 | Villemoes | Status | New => Under Review |
2017-06-14 14:31 | Villemoes | Assigned To | => ajosey |
2017-06-14 14:31 | Villemoes | Name | => Rasmus Villemoes |
2017-06-14 14:31 | Villemoes | Section | => fmemopen |
2017-06-14 16:41 | shware_systems | Note Added: 0003761 | |
2017-06-14 19:35 | Villemoes | Note Added: 0003762 | |
2017-06-14 23:06 | shware_systems | Note Added: 0003763 | |
2017-06-14 23:14 | shware_systems | Note Edited: 0003763 | |
2017-06-22 07:23 | Villemoes | Note Added: 0003796 | |
2018-11-15 17:33 | geoffclare | Note Added: 0004169 | |
2018-11-15 17:35 | geoffclare | Interp Status | => --- |
2018-11-15 17:35 | geoffclare | Final Accepted Text | => Note: 0004169 |
2018-11-15 17:35 | geoffclare | Status | Under Review => Resolved |
2018-11-15 17:35 | geoffclare | Resolution | Open => Accepted As Marked |
2018-11-15 17:35 | geoffclare | Tag Attached: tc3-2008 | |
2018-11-15 17:37 | geoffclare | Note Edited: 0004169 | |
2018-12-13 16:35 | geoffclare | Relationship added | has duplicate 0001152 |
2019-11-05 12:07 | geoffclare | Status | Resolved => Applied |
2024-06-11 08:52 | agadmin | Status | Applied => Closed |
Mantis 1.1.6[^] Copyright © 2000 - 2008 Mantis Group |