View Issue Details

IDProjectCategoryView StatusLast Update
00011561003.1(2016/18)/Issue7+TC2System Interfacespublic2019-01-14 16:57
ReporterFlorian Weimer Assigned To 
PrioritynormalSeverityEditorialTypeClarification Requested
Status ClosedResolutionDuplicate 
NameFlorian Weimer
OrganizationRed Hat
User Referencehttps://sourceware.org/bugzilla/show_bug.cgi?id=21735
Sectionfflush
Page Number859
Line Number28961
Interp Status---
Final Accepted Text
Summary0001156: Should fflush (NULL) flush streams not backed by files?
DescriptionThe description of fflush was not updated when open_memstream was added. This means that currently, fflush (NULL) is also required to perform an fflush operation on such streams. I think fflush (NULL) is predominantly useful for file-based streams (maybe before a call to fork), and the global bookkeeping required for flushing in-memory streams is unecessary.
Desired ActionClarify that fflush (NULL) only affects streams associated with an open file. (The term “stream associated with an open file” is already used in the description of setvbuf.)
TagsNo tags attached.

Relationships

duplicate of 0000626 Closedajosey 1003.1(2008)/Issue 7 Unclear whether fflush(0) and/or exit() affect memory streams 

Activities

geoffclare

2019-01-10 16:18

manager   bugnote:0004203

Last edited: 2019-01-14 16:58

OLD resolution (this bug is now closed as a dup of bug 0000626).

On page 859 line 28961 section fflush, change:
all streams for which the behavior is defined above
to:
all streams that are associated with an open file and for which the behavior is defined above


osoong

2019-01-11 20:11

reporter   bugnote:0004206

Unless I've misread something, this change seems to conflict with the interpretation given for 0000626.

shware_systems

2019-01-12 23:47

reporter   bugnote:0004207

I believe the distinction is 'stream' in this context relates to anything that can be referenced by a FILE * or file handle/descriptor (via fdopen()), but 'open file' refers to the file descriptions. It is not limited to those of regular files on media that are used when these are opened, as implied by the Desired Action. What data structure is used internally to represent the file description can vary per file type. Portable applications have to contend with a call to setvbuf() may not be supported by some of these implementations of memstream type file descriptions, some may not set timestamps as 626 focused on, or some may not support more than one wide char of ungetc(), so these may be 'open files' but don't have the 'behavior defined above'.

Where it could be clearer, to me, is that not being able to do one unsupported operation doesn't mean the flush can be skipped entirely; the implementation should still do the defined operations that are supported.

geoffclare

2019-01-14 16:57

manager   bugnote:0004209

This is being closed as a duplicate of bug 0000626.

Issue History

Date Modified Username Field Change
2017-07-20 08:13 Florian Weimer New Issue
2017-07-20 08:13 Florian Weimer Name => Florian Weimer
2017-07-20 08:13 Florian Weimer Organization => Red Hat
2017-07-20 08:13 Florian Weimer User Reference => https://sourceware.org/bugzilla/show_bug.cgi?id=21735
2017-07-20 08:13 Florian Weimer Section => fflush
2017-07-20 08:13 Florian Weimer Page Number => unknown
2017-07-20 08:13 Florian Weimer Line Number => unknown
2019-01-10 16:18 geoffclare Note Added: 0004203
2019-01-10 16:19 geoffclare Page Number unknown => 859
2019-01-10 16:19 geoffclare Line Number unknown => 28961
2019-01-10 16:19 geoffclare Interp Status => ---
2019-01-10 16:19 geoffclare Final Accepted Text => 0001156:0004203
2019-01-10 16:19 geoffclare Status New => Resolved
2019-01-10 16:19 geoffclare Resolution Open => Accepted As Marked
2019-01-10 16:19 geoffclare Tag Attached: tc3-2008
2019-01-11 20:11 osoong Note Added: 0004206
2019-01-11 23:03 eblake Relationship added related to 0000626
2019-01-12 23:47 shware_systems Note Added: 0004207
2019-01-14 16:57 geoffclare Final Accepted Text 0001156:0004203 =>
2019-01-14 16:57 geoffclare Note Added: 0004209
2019-01-14 16:57 geoffclare Status Resolved => Closed
2019-01-14 16:57 geoffclare Resolution Accepted As Marked => Duplicate
2019-01-14 16:57 geoffclare Tag Detached: tc3-2008
2019-01-14 16:57 geoffclare Relationship replaced duplicate of 0000626
2019-01-14 16:58 geoffclare Note Edited: 0004203