A NOTE has been added to this issue. 
====================================================================== 
https://austingroupbugs.net/view.php?id=1810 
====================================================================== 
Reported By:                alanc
Assigned To:                
====================================================================== 
Project:                    Issue 8 drafts
Issue ID:                   1810
Category:                   System Interfaces
Type:                       Clarification Requested
Severity:                   Editorial
Priority:                   normal
Status:                     New
Name:                       Alan Coopersmith 
Organization:               Oracle Solaris Engineering 
User Reference:              
Section:                    fdopen() 
Page Number:                917 
Line Number:                31300-31397 
Final Accepted Text:         
====================================================================== 
Date Submitted:             2024-02-10 17:41 UTC
Last Modified:              2024-04-15 15:59 UTC
====================================================================== 
Summary:                    fdopen() can only be used once per file descriptor
======================================================================
Relationships       ID      Summary
----------------------------------------------------------------------
related to          0001809 close() guidance to use fclose() should...
====================================================================== 

---------------------------------------------------------------------- 
 (0006750) geoffclare (manager) - 2024-04-15 15:59
 https://austingroupbugs.net/view.php?id=1810#c6750 
---------------------------------------------------------------------- 
After page 899 line 30638, add to fclose() APPLICATION USAGE:<blockquote>If
the file descriptor associated with the stream has already been closed,
<i>fclose</i>() fails with an [EBADF] error (after it deallocates the
stream). However, in the event that the same file descriptor number is
allocated by some other operation (such as <i>dup</i>(), <i>fopen</i>(),
<i>open</i>(), <i>pipe</i>(), <i>socket</i>(), and so forth), before
<i>fclose</i>() is called, the <i>fclose</i>() call will close this newly
allocated file descriptor instead. Therefore, applications which close the
file descriptor before calling <i>fclose</i>() should ensure that they do
not perform any file open operations in between closing the file descriptor
and calling <i>fclose</i>(). This also applies in the event that two
streams have the same associated file descriptor; calling <i>fclose</i>()
on the first stream closes the file descriptor associated with both
streams, and then calling <i>fclose</i>() on the second stream has the same
risk described above.  See also xref to P522, L18532 XSH 2.5.1 Interaction
of File Descriptors and Standard I/O Streams.</blockquote>
After page 918 line 31349, add to fdopen() APPLICATION
USAGE:<blockquote>See also the APPLICATION USAGE for
<i>fclose</i>().</blockquote> 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2024-02-10 17:41 alanc          New Issue                                    
2024-02-10 17:41 alanc          Name                      => Alan Coopersmith
2024-02-10 17:41 alanc          Organization              => Oracle Solaris
Engineering
2024-02-10 17:41 alanc          Section                   => fdopen()        
2024-02-10 17:41 alanc          Page Number               => 917             
2024-02-10 17:41 alanc          Line Number               => 31300-31397     
2024-02-10 18:57 Don Cragun     Relationship added       related to 0001809  
2024-02-12 19:09 alanc          Note Added: 0006652                          
2024-04-11 11:02 geoffclare     Note Added: 0006744                          
2024-04-11 20:48 alanc          Note Added: 0006749                          
2024-04-15 15:59 geoffclare     Note Added: 0006750                          
======================================================================


  • [Issue 8 dra... Austin Group Bug Tracker via austin-group-l at The Open Group
    • [Issue ... Austin Group Bug Tracker via austin-group-l at The Open Group
    • [Issue ... Austin Group Bug Tracker via austin-group-l at The Open Group
    • [Issue ... Austin Group Bug Tracker via austin-group-l at The Open Group
    • [Issue ... Austin Group Bug Tracker via austin-group-l at The Open Group
    • [Issue ... Austin Group Bug Tracker via austin-group-l at The Open Group
    • [Issue ... Austin Group Bug Tracker via austin-group-l at The Open Group

Reply via email to