Article 130692 of comp.os.vms: Path: nntpd.lkg.dec.com!lead.zk3.dec.com!crl.dec.com!crl.dec.com!bloom-beacon.mit.edu!gatech!howland.reston.ans.net!math.ohio-state.edu!jussieu.fr!oleane!simtel!news.sprintlink.net!in2.uu.net!news3.digex.net!dcc11293.slip.digex.net!user From: dpm@access.digex.net (David P. Murphy) Newsgroups: comp.os.vms Subject: Re: C example needed: sys$faol() within an Exception Handler Date: Mon, 02 Oct 1995 21:40:01 -0500 Organization: Phase of the Moon Software, Inc. Lines: 79 Message-ID: References: <44pkng$1et3@hearst.cac.psu.edu> NNTP-Posting-Host: dcc11293.slip.digex.net In article <44pkng$1et3@hearst.cac.psu.edu>, jlw@psulias.psu.edu wrote: >I'm having trouble getting complete output in the exception handler listed >herein. I've tried every angle I can think of, but every one seems to >stop the output at the first FAO substitution. For example, if the >exception handler is entered with an Access Violation, all I get is > > "Access violation, reason mask=". well ,lance, i've got the answer and you're not going to like it: $ ty hand.c #include #include #include #include #include #include #include main() { static char buf[512]; static unsigned short i = 0; static $DESCRIPTOR(dsc$buf,buf); static unsigned long s[10]; $DESCRIPTOR(caps, "access violation, reason mask=!XB, virtual address=!XL, pc=!XL, ps=!XL"); $DESCRIPTOR(lows, "access violation, reason mask=!xb, virtual address=!xl, pc=!xl, ps=!xl"); s[0] = 1; s[1] = 0xDEADBEEF; s[2] = 0x314; s[3] = 0x2718; sys$faol(&caps, &i, &dsc$buf, s); buf[i] = '\0'; printf("%s\n", buf); sys$faol(&lows, &i, &dsc$buf, s); buf[i] = '\0'; printf("%s\n", buf); exit(EXIT_SUCCESS); } $ cc hand $ link hand $ r hand access violation, reason mask=01, virtual address=DEADBEEF, pc=00000314, ps=00002718 access violation, reason mask= $ yes indeed, the strings come back with *lowercase* FAO directives, which of course means they're not really FAO directives at all. short of scanning the string to look for bangs and raising the {1,2,3} characters after each, i'm afraid you're going to have to call $PUTMSG(). i'd be more than happy to send you a set of working functions from my library if you'd like; just email either of my addresses. i took the liberty of checking the source listings, and to no one's surprise it turns out that strerror(), in [V61.CRTL.LIS]PERROR.LIS, simply invokes sys$getmsg() and then carefully changes each and every uppercase character into the appropriate lowercase character. ken, i realize that your entire life is devoted to making VMS and DECC into a complete unix-look-alike, and that you usually do end up doing the Right Thing, and that it seemed like the Right Thing to do to make the strings lowercase like the unix geeks are used to, but this is one of those cases where you have to sit there and say, "uh-oh. wrong decision." on the other hand, perhaps there is a reason beyond mere esthetics for ruining the usefulness of the string returned . . . i'd be interested in hearing it. and no, i'm not just picking on him: "Ken Cowan" is the last person to have edited that file as of V6.1 ;-) ok dpm --- David P. Murphy mailto:murphy@connor.datametrics.com (work) systems programmer mailto:dpm@access.digex.net (personal) http://www.access.digex.net/~dpm COGITO ERGO DISCLAIMUM ftp://ftp.digex.net/pub/access/dpm