Sujet : Re: C Error Number to Symbol
De : seaohveh (at) *nospam* hoffmanlabs.invalid (Stephen Hoffman)
Groupes : comp.os.vmsDate : 19. Mar 2025, 22:36:25
Autres entêtes
Organisation : HoffmanLabs LLC
Message-ID : <vrfdcp$1nopf$1@dont-email.me>
References : 1
User-Agent : Unison/2.2
On 2025-03-19 01:02:41 +0000, Michael Brown said:
This might be a very simple question but I can't find any reference to it on the net.
Working in C, how do you get the RMS$_CODE symbol for any given error number as returned from any operation? I use strerror() to get an interpretation but it does not include said symbol.
exit(rms_return_number); will print it out so I know it must be possible.
You're seemingly assuming C is integrated with OpenVMS, and in many ways it is just not. Here, you will want to call sys$getmsg, sys$fao, or sys$faol, among other OpenVMS system services and potentially RTL calls, to process the OpenVMS condition values.
BTW: One wrinkle with wrapping $fao and $faol calls into C calls with variable argument lists into the call: SS$ calls have one argument, RMS codes have two, and the rest have whatever arguments the user had specified. I have code that deals with this, not that I can find a copy posted anywhere at the moment.
Here? I'd start with the programming concepts manual for the OpenVMS parts of the programming environment, and then the C manuals for the C-specific pieces. Stuff like OpenVMS signals, descriptors, itemlists and related aren't particularly integrated into C. Not past data structure definitions and a code slog or two or five.
Page 100:
https://docs.vmssoftware.com/docs/vsi-c-run-time-library-reference-manual-for-openvms-systems.pdf See strerror(int errcode, int vmserrcode), as well.
Related:
https://www.digiater.nl/openvms/freeware/v80/hoffman_examples/rms_examples.c-- Pure Personal Opinion | HoffmanLabs LLC