Anonymous | Login | 2024-11-12 18:14 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 | ||
0001526 | [Issue 8 drafts] System Interfaces | Objection | Enhancement Request | 2021-10-19 10:53 | 2024-06-11 09:12 | ||
Reporter | geoffclare | View Status | public | ||||
Assigned To | |||||||
Priority | normal | Resolution | Accepted As Marked | ||||
Status | Closed | Product Version | Draft 2.1 | ||||
Name | Geoff Clare | ||||||
Organization | The Open Group | ||||||
User Reference | |||||||
Section | fdopen() | ||||||
Page Number | 823 | ||||||
Line Number | 28083-28093 | ||||||
Final Accepted Text | See Note: 0005600. | ||||||
Summary | 0001526: Update fdopen() mode description to match new fopen() terminology | ||||||
Description |
The new 'e' and 'x' mode string characters for fopen() have been accounted for on the fdopen() page using "prefix" terminology, which is being changed for fopen() via bug 0001302 (C17 alignment). The fdopen() page should change to match the new terminology, but the need for this change does not result (directly) from C17 alignment, so it is being handled by a separate bug instead of in 1302. The current wording is also vague about what happens if there is a mismatch between the O_APPEND flag on the open file description and the use of 'w' versus 'a' in the mode. The only clue is that the rationale states "a good implementation of append (a) mode would cause the O_APPEND flag to be set", which implies that it is intentional that both behaviours are allowed when O_APPEND is clear and 'a' is used. I tried test programs on Linux (glibc), Solaris, MacOS and HP-UX, and the results were: * Only Linux set O_APPEND if it was clear when using "a" * All four left O_APPEND set if it was set when using "w" Therefore the suggested changes make it unspecified for "a" but mandate leaving O_APPEND set for "w". As an editorial matter, the use of the phrase "Open a file" is also problematic since fdopen() does not actually open a file. Finally, the new changes include a typographical conventions change to use quotes around mode characters instead of italicising them. This change is also needed on the popen() page for consistency. |
||||||
Desired Action |
On page 823 line 28083 section fdopen(), change:The mode argument points to a character string, which shall also be valid for fopen(). The string prefix shall have the following effects:to: The mode argument points to a character string that is valid for fopen(). If the string begins with one of the following characters, then the stream shall be associated with fildes as specified. Otherwise, the behavior is undefined. On page 824 line 28124 section fdopen(), change: The meanings of the mode arguments of fdopen() and fopen() differ. With fdopen(), open for write (w or w+) does not truncate, and append (a or a+) cannot create for writing. The mode argument formats that include a b are allowed for consistency with the ISO C standard function fopen(). The b has no effect on the resulting stream. Although not explicitly required by this volume of POSIX.1-202x, a good implementation of append (a) mode would cause the O_APPEND flag to be set. Since fdopen() does not create a file, the x mode modifier is silently ignored. The e mode modifier is ...to: The meanings of the mode arguments of fdopen() and fopen() differ. With fdopen(), write (<tt>'w'</tt>) mode cannot create or truncate a file, and append (<tt>'a'</tt>) mode cannot create a file. Inclusion of a <tt>'b'</tt> in the mode argument is allowed for consistency with fopen(); the <tt>'b'</tt> has no effect on the resulting stream. Implementations differ as to whether specifying append (<tt>'a'</tt>) mode causes the O_APPEND flag to be set if it was clear, but they are encouraged to do so. Since fdopen() does not create a file, the <tt>'x'</tt> mode modifier is silently ignored. The <tt>'e'</tt> mode modifier is ... On page 1421 line 47441, 47447, 47453 section popen(), and page 1422 line 47499 section popen(), and page 1423 line 47508, 47509, 47525, 47532, 47533 section popen(), and page 1428 line 47785 section popen(): change r, w, and e to <tt>'r'</tt>, <tt>'w'</tt>, and <tt>'e'</tt>, respectively. On page 1422 line 47505 section popen(), change: The behavior of popen() is specified for values of mode of r, w, re, and we. Other modes such as rb and wb might ...to: The behavior of popen() is specified for values of mode of <tt>"r"</tt>, <tt>"w"</tt>, <tt>"re"</tt>, and <tt>"we"</tt>. Other modes such as <tt>"rb"</tt> and <tt>"wb"</tt> might ... On page 1423 line 47508 section popen(), change: robert the robotto: <tt>"robert the robot"</tt> On page 1423 line 47536 section popen(), change: wfto: <tt>"wf"</tt> On page 1423 line 47542 section popen(), change: rfto: <tt>"rf"</tt> |
||||||
Tags | issue8 | ||||||
Attached Files | |||||||
|
Relationships | |||||||
|
Issue History | |||
Date Modified | Username | Field | Change |
2021-10-19 10:53 | geoffclare | New Issue | |
2021-10-19 10:53 | geoffclare | Name | => Geoff Clare |
2021-10-19 10:53 | geoffclare | Organization | => The Open Group |
2021-10-19 10:53 | geoffclare | Section | => fdopen() |
2021-10-19 10:53 | geoffclare | Page Number | => 823 |
2021-10-19 10:53 | geoffclare | Line Number | => 28083-28093 |
2021-10-19 10:58 | geoffclare | Relationship added | related to 0001302 |
2021-10-19 16:29 | kre | Note Added: 0005507 | |
2021-10-19 16:32 | kre | Note Edited: 0005507 | |
2021-10-21 08:48 | geoffclare | Note Added: 0005508 | |
2022-01-13 17:15 | geoffclare | Note Added: 0005600 | |
2022-01-13 17:18 | Don Cragun | Final Accepted Text | => See Note: 0005600. |
2022-01-13 17:18 | Don Cragun | Status | New => Resolved |
2022-01-13 17:18 | Don Cragun | Resolution | Open => Accepted As Marked |
2022-01-13 17:19 | Don Cragun | Tag Attached: issue8 | |
2022-02-11 15:23 | geoffclare | Status | Resolved => Applied |
2024-06-11 09:12 | agadmin | Status | Applied => Closed |
Mantis 1.1.6[^] Copyright © 2000 - 2008 Mantis Group |