The following issue has been SUBMITTED. ====================================================================== 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-02-10 17:41 UTC ====================================================================== Summary: fdopen() can only be used once per file descriptor Description: Nothing I see in the current description states that the same file descriptor should not be passed multiple times to fdopen().
But since the fclose() on the returned stream will also close the underlying file descriptor, once one stream returned from fdopen() for a given file descriptor is closed, all others will become broken or potentially refer to the wrong fd once the fd is reused. Desired Action: Add appropriate language to warn that applications must only use fdopen() once per file descriptor. ====================================================================== 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 ======================================================================