Austin Group Defect Tracker

Aardvark Mark IV

Viewing Issue Simple Details Jump to Notes ] Issue History ] Print ]
ID Category Severity Type Date Submitted Last Update
0001810 [Issue 8 drafts] System Interfaces Editorial Clarification Requested 2024-02-10 17:41 2024-02-12 19:09
Reporter alanc View Status public  
Assigned To
Priority normal Resolution Open  
Status New   Product Version Draft 4
Name Alan Coopersmith
Organization Oracle Solaris Engineering
User Reference
Section fdopen()
Page Number 917
Line Number 31300-31397
Final Accepted Text
Summary 0001810: 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.
Tags No tags attached.
Attached Files

- Relationships
related to 0001809New close() guidance to use fclose() should also discuss fdopen() 

-  Notes
alanc (reporter)
2024-02-12 19:09

After further reflection, I believe the warning should be that applications
must not use fdopen() on an fd already associated with a stdio stream,
whether that be an fd they already called fdopen() on, an fd returned by
fileno() on an existing stream, the default fds (0, 1, 2) associated with
stdin/stdout/stderr, etc.

- 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

Mantis 1.1.6[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker