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
0001664 [Issue 8 drafts] System Interfaces Comment Error 2023-04-11 15:37 2024-06-11 09:12
Reporter geoffclare View Status public  
Assigned To
Priority normal Resolution Accepted  
Status Closed   Product Version Draft 3
Name Geoff Clare
Organization The Open Group
User Reference
Section readdir()
Page Number 1850, 1851
Line Number 61088, 61117
Final Accepted Text
Summary 0001664: Some readdir() non-normative text needs updating to reflect normative text changes
Description The resolution of bug 0000696 missed an APPLICATION USAGE change, and the RATIONALE change could be improved.
Desired Action On page 1850 line 61088 section readdir(), change:
The readdir_r() function is thread-safe and shall return values in a user-supplied buffer instead of possibly using a static data area that may be overwritten by each call.
to:
The readdir_r() function returns values in a user-supplied buffer, but does not allow the size of the buffer to be specified by the caller. If {NAME_MAX} is indeterminate, there is no way for an application to know how large the buffer needs to be and readdir_r() cannot safely be used.

On page 1851 line 61117 section readdir(), change:
The readdir_r() function returns values in a user-supplied buffer instead of possibly using a static data area that may be overwritten by each call. Either the {NAME_MAX} compile-time constant or the corresponding pathconf() option can be used to determine the maximum sizes of returned pathnames. However, since the size of a filename has no limit on some filesystem types, there is no way to reliably allocate a buffer large enough to hold a filename being returned by readdir_r(). Therefore, readdir_r() has been marked obsolescent and readdir() is now required to be thread safe as long as there are no concurrent calls to it on a single directory stream.
to:
Historically, readdir() returned a pointer to an internal static buffer that was overwritten by each call. The readdir_r() function was added as a thread-safe alternative that returns values in a user-supplied buffer. However, it does not allow the size of the buffer to be specified by the caller, and so is only usable if {NAME_MAX} is a compile-time constant or fpathconf() with _SC_NAME_MAX returns a value other than -1. If {NAME_MAX} is indeterminate (indicated by fpathconf() returning -1), there is no way to reliably allocate a buffer large enough to hold a filename being returned by readdir_r(). Therefore, readdir_r() has been marked obsolescent and readdir() is now required to be thread safe as long as there are no concurrent calls to it on a single directory stream.

Tags applied_after_i8d3, issue8
Attached Files

- Relationships
related to 0000696Closed 1003.1(2013)/Issue7+TC1 either NAME_MAX shouldn't be optional, or readdir_r() needs clarification 

There are no notes attached to this issue.

- Issue History
Date Modified Username Field Change
2023-04-11 15:37 geoffclare New Issue
2023-04-11 15:37 geoffclare Name => Geoff Clare
2023-04-11 15:37 geoffclare Organization => The Open Group
2023-04-11 15:37 geoffclare Section => readdir()
2023-04-11 15:37 geoffclare Page Number => 1850, 1851
2023-04-11 15:37 geoffclare Line Number => 61088, 61117
2023-04-11 15:38 geoffclare Relationship added related to 0000696
2023-06-08 16:00 Don Cragun Status New => Resolved
2023-06-08 16:00 Don Cragun Resolution Open => Accepted
2023-06-08 16:02 Don Cragun Tag Attached: issue8
2023-06-27 15:15 geoffclare Status Resolved => Applied
2023-06-27 15:15 geoffclare Tag Attached: applied_after_i8d3
2024-06-11 09:12 agadmin Status Applied => Closed


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