Issue Details (XML | Word | Printable)

Key: STDCXX-265
Type: Bug Bug
Status: Open Open
Priority: Minor Minor
Assignee: Unassigned
Reporter: Scott (Yu) Zhong
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
C++ Standard Library

[IBM z/OS] runtime locale failure due to lack of native support for stat()

Created: 01/Aug/06 08:05 PM   Updated: 14/May/08 06:18 PM
Return to search
Component/s: 22. Localization
Affects Version/s: 4.1.2, 4.1.3, 4.1.4, 4.2.0, 4.2.1
Fix Version/s: 4.2.2

Time Tracking:
Original Estimate: 3h
Original Estimate - 3h
Remaining Estimate: 3h
Remaining Estimate - 3h
Time Spent: Not Specified
Remaining Estimate - 3h

Environment: z/OS 1.6, DASD 3390-3 Emulation
Issue Links:
Reference
 

Severity: Compiler Error


 Description  « Hide
Native MVS has filename limitation of 8 characters and does not support stat function.

examples of where stat function is being used is:

facet.cpp:103
---------------------------------------------------------------------------------------
static
void* __rw_mmap (const char* fname, _RWSTD_SIZE_T *size)
{
_RWSTD_ASSERT (0 != fname);
_RWSTD_ASSERT (0 != size);

#if !defined (_MSC_VER)
struct stat sb;
if (stat (fname, &sb) == -1)
#else
struct _stat sb;
if (_stat (fname, &sb) == -1)
#endif
return 0;

*size = sb.st_size;

#if !defined(_MSC_VER)
const int fd = open (fname, O_RDONLY);

if (-1 == fd)
return 0;
---------------------------------------------------------------------------------------

A quick search in the stdlib source found that util/path.cpp, setlocale.cpp, and locale_core.cpp uses stat function. The best alternative I found to stat on native MVS is to use either open/fopen stream as a parameter to fstat function.

The 8 character max filename limitation impedes roguewave's locale to function. This is because some roguewave's locale database file names are longer than 8 character long: LC_COLLATE, LC_MONETARY, LC_NUMERIC, LC_MESSAGES.



 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Martin Sebor added a comment - 14/May/08 06:17 PM
See also STDCXX-908 for a similar issue with mmap().

Martin Sebor added a comment - 14/May/08 06:18 PM
Let's try to see if there's an easy way to work around this in 4.2.2.