[comp.lang.c] signals, longjmp, and ANSI C

merriman@ccavax.camb.com (05/25/90)

Distribution: usa
Organization: Cambridge Computer Associates, Inc.
Lines: 26

In article <T3O3PX1@xds13.ferranti.com>, peter@ficc.ferranti.com (Peter da Silva) writes:
> I said: you can't do system calls inside RSX ASTs.
> 
> In article <24581.265ae798@ccavax.camb.com> merriman@ccavax.camb.com writes:
>> Really? I've never heard of a restriction against making system calls from
>> an asynchronous trap in RSX. I've done it many times with no trouble --
>> I learned the technique from a DEC RSX programming class. 
> 
> It's been too long, so I may have misremembered. This was in 11/M, not M+.
> There were restrictions as to what you could do in an AST, but I guess it's
> not as extreme as that.
You can do anything in a VMS or RSX AST that takes into consideration 
the logical concurrency issues involved in the application. Most native
library and system services are designed to be AST-re-entrant. Some brain-dead
C RTL implementations don't understand what this means.

> 
> Anyway, you sure couldn't longjmp out of one, at least not in 11/M. I know
> that because I wanted to do it for a Forth implementation.
longjump is not an RSX concept. You must have been using something cobbled up 
to mimic UNIX behavior rather than taking advantage of the operating system
features.
> -- 
> `-_-' Peter da Silva. +1 713 274 5180.  <peter@ficc.ferranti.com>
>  'U`  Have you hugged your wolf today?  <peter@sugar.hackercorp.com>
> @FIN  Dirty words: Zhghnyyl erphefvir vayvar shapgvbaf.

peter@ficc.ferranti.com (peter da silva) (05/25/90)

In article <24654.265c32f6@ccavax.camb.com>, merriman@ccavax.camb.com writes:
> You can do anything in a VMS or RSX AST that takes into consideration 
> the logical concurrency issues involved in the application. Most native
> library and system services are designed to be AST-re-entrant. Some brain-dead
> C RTL implementations don't understand what this means.

There sure was no C RTL involved when I was doing this. If it was a run-time
library problem it was in the Fortran RTL, because that's what I was running
Forth under. This was in the early '80s, and the system probably dated back
before that.

> > Anyway, you sure couldn't longjmp out of one, at least not in 11/M. I know
> > that because I wanted to do it for a Forth implementation.
                                         ^^^^^--- This is an important word.

> longjump is not an RSX concept.

Longjmp is a *language* concept, and has nothing to do with any O/S.

> You must have been using something cobbled up 
> to mimic UNIX behavior

I must have. Go back and read what I wrote and tell me why I MUST HAVE
been "using something cobbled up to mimic UNIX behaviour". Let's see, I was
talking about C and Forth and RSX. Nothing to do with UNIX there. You MUST
HAVE jumped to a conclusion in the absence of evidence.

This was running John James' FIG Forth for the PDP-11, with a Fortran
skeleton to avoid having to figure out how to do serial file I/O via
QIOs. (ech) And I couldn't do a QIO$W from an AST. I guess this falls
under the "takes into consideration the logical concurrency issues..."
part.
-- 
`-_-' Peter da Silva. +1 713 274 5180.  <peter@ficc.ferranti.com>
 'U`  Have you hugged your wolf today?  <peter@sugar.hackercorp.com>
@FIN  Dirty words: Zhghnyyl erphefvir vayvar shapgvbaf.