Re: C Error Number to Symbol

Liste des GroupesRevenir à co vms 
Sujet : Re: C Error Number to Symbol
De : seaohveh (at) *nospam* hoffmanlabs.invalid (Stephen Hoffman)
Groupes : comp.os.vms
Date : 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
Date Sujet#  Auteur
19 Mar 25 * C Error Number to Symbol16Michael Brown
19 Mar 25 +* Re: C Error Number to Symbol14Simon Clubley
19 Mar 25 i+* Re: C Error Number to Symbol8Craig A. Berry
19 Mar 25 ii`* Re: C Error Number to Symbol7Michael Brown
19 Mar 25 ii `* Re: C Error Number to Symbol6Craig A. Berry
19 Mar 25 ii  `* Re: C Error Number to Symbol5Arne Vajhøj
19 Mar 25 ii   `* Re: C Error Number to Symbol4Michael Brown
19 Mar 25 ii    `* Re: C Error Number to Symbol3Arne Vajhøj
20 Mar 25 ii     `* Re: C Error Number to Symbol2Michael Brown
20 Mar 25 ii      `- Re: C Error Number to Symbol1Arne Vajhøj
19 Mar 25 i`* Re: C Error Number to Symbol5Michael Brown
19 Mar 25 i +* Re: C Error Number to Symbol2Chris Townley
19 Mar 25 i i`- Re: C Error Number to Symbol1Michael Brown
19 Mar 25 i `* Re: C Error Number to Symbol2Robert A. Brooks
20 Mar 25 i  `- Re: C Error Number to Symbol1Michael Brown
19 Mar 25 `- Re: C Error Number to Symbol1Stephen Hoffman

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal