longjmp() from nested signal handlers

Henry Spencer henry at utzoo.uucp
Fri Apr 8 04:05:14 AEST 1988


> I thought unix implementers these days use a similar scheme to
> protect sensitive portions of kernel and library function code.

Kernel, yes, library, no.

> I suppose it would be asking to much to require all C implementations
> to do this.  I don't mind enclosing malloc() calls with protect()/unprotect(),
> and I usually have some uninterruptable code of my own next to
> these calls, but I wouldn't want to have to surround every getc(), printf(),
> etc.

The implementors don't want to have to do that either, which is why they
generally don't.

> Anyway, if anyone is still listening, what versions of unix *do not*
> sensitive system code from interrupts?

Essentially all of them shield kernel code, but they do it by postponing
the interrupt, not by dancing around it in software after it happens.
Nobody that I know of makes any real attempt to shield library functions.
For one thing, it can be quite difficult to get all the details right.
For another thing, THIS PROBLEM HAS ALWAYS EXISTED, and programs that
ignore it are broken already.  X3J11 did not see any compelling reason
to tackle the difficult problem of unbreaking them.
-- 
"Noalias must go.  This is           |  Henry Spencer @ U of Toronto Zoology
non-negotiable."  --DMR              | {allegra,ihnp4,decvax,utai}!utzoo!henry



More information about the Comp.lang.c mailing list