- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- Wrong declaraiton of fdopen() in <stdio.h>
Operating System - OpenVMS
1819825
Members
3142
Online
109607
Solutions
Forums
Categories
Company
Local Language
юдл
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
юдл
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-28-2010 09:53 AM
тАО06-28-2010 09:53 AM
Wrong declaraiton of fdopen() in <stdio.h>
$ libr/extra=crtl_class/out=tt sys$share:decc$rtldef.tlb
VMS_V83-016
$
According to CRTL Manual and online help, the fdopen() function must be called with access mode (e.g. "ctx=bin") that was specified in the original open() or creat() call.
However, the function is not declared as a function with variable number of arguments in. It makes it impossible to use the function for a file opened with explicitly specified access mode. Without the access mode, the function fails with EINVAL.
$ libr/extra=crtl_class/out=tt sys$share:decc$rtldef.tlb
VMS_V83-016
$
Thanks,
-Boris
VMS_V83-016
$
According to CRTL Manual and online help, the fdopen() function must be called with access mode (e.g. "ctx=bin") that was specified in the original open() or creat() call.
However, the function is not declared as a function with variable number of arguments in
$ libr/extra=crtl_class/out=tt sys$share:decc$rtldef.tlb
VMS_V83-016
$
Thanks,
-Boris
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-28-2010 11:48 AM
тАО06-28-2010 11:48 AM
Re: Wrong declaraiton of fdopen() in <stdio.h>
Wrong usage of fdopen() in user's code?
Around here, the actual HELP CRTL text is:
[...]
Note that the access mode specified must
agree with the mode used to originally open
the file. This includes binary/text access
mode ("b" mode on fdopen and the "ctx=bin"
option on creat or open).
[...]
I took this to mean that if one used
"ctx=bin" in his creat() or open(), then he
would need to use "b" in his fdopen().
Do you have a failing test case? I can't see
exactly what you're doing.
I seem to recall defining O_BINARY myself on
VMS, using it to identify a "ctx=bin" file,
and then supplying my own openfd_vms()
function which masks off that bit before
calling the real open(). Cdrtools, perhaps?
Around here, the actual HELP CRTL text is:
[...]
Note that the access mode specified must
agree with the mode used to originally open
the file. This includes binary/text access
mode ("b" mode on fdopen and the "ctx=bin"
option on creat or open).
[...]
I took this to mean that if one used
"ctx=bin" in his creat() or open(), then he
would need to use "b" in his fdopen().
Do you have a failing test case? I can't see
exactly what you're doing.
I seem to recall defining O_BINARY myself on
VMS, using it to identify a "ctx=bin" file,
and then supplying my own openfd_vms()
function which masks off that bit before
calling the real open(). Cdrtools, perhaps?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-28-2010 01:23 PM
тАО06-28-2010 01:23 PM
Re: Wrong declaraiton of fdopen() in <stdio.h>
"
This includes binary/text access
mode ("b" mode on fdopen and the "ctx=bin"
option on creat or open).
"
It may be a user error but it depends on how one interprets the word "includes" in the quote above: just "ctx=bin" or any access mode.
On VMS, I call open() with "ctx=stm" access mode and I thought that I need to specify it in a call to fdopen() also, as an optional argument, because "ctx=stm" does not map to any standard access mode. Now I don't think I need it.
Thanks for the reply. I'll close this thread. Perhaps, the documentation can be updated to make it clear that FILE pointer returned by fdopen() "inherits" properties of the original file descriptor: access mode, sharing, ... etc so there is no need to specify them explicitly on fdopen() call.
Thanks again,
-Boris
This includes binary/text access
mode ("b" mode on fdopen and the "ctx=bin"
option on creat or open).
"
It may be a user error but it depends on how one interprets the word "includes" in the quote above: just "ctx=bin" or any access mode.
On VMS, I call open() with "ctx=stm" access mode and I thought that I need to specify it in a call to fdopen() also, as an optional argument, because "ctx=stm" does not map to any standard access mode. Now I don't think I need it.
Thanks for the reply. I'll close this thread. Perhaps, the documentation can be updated to make it clear that FILE pointer returned by fdopen() "inherits" properties of the original file descriptor: access mode, sharing, ... etc so there is no need to specify them explicitly on fdopen() call.
Thanks again,
-Boris
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-28-2010 01:25 PM
тАО06-28-2010 01:25 PM
Re: Wrong declaraiton of fdopen() in <stdio.h>
Documentation issue, not a bug in the CRTL.
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Learn About
News and Events
Support
© Copyright 2025 Hewlett Packard Enterprise Development LP