Deutsch   English   Français   Italiano  
<vrfdcp$1nopf$1@dont-email.me>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail
From: Stephen Hoffman <seaohveh@hoffmanlabs.invalid>
Newsgroups: comp.os.vms
Subject: Re: C Error Number to Symbol
Date: Wed, 19 Mar 2025 17:36:25 -0400
Organization: HoffmanLabs LLC
Lines: 45
Message-ID: <vrfdcp$1nopf$1@dont-email.me>
References: <f96165dde75337ce16c809cf96d03a24216699a4@i2pn2.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 19 Mar 2025 22:36:26 +0100 (CET)
Injection-Info: dont-email.me; posting-host="92e93d81ce8f448dff9ae26f85a15745";
	logging-data="1827631"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX18WBBgQD5yKpDBrAxnPMBMpW9RtUctNmN8="
User-Agent: Unison/2.2
Cancel-Lock: sha1:d8ikNkBpZX49RpTIbkc2P4gQT8o=
Bytes: 2623

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