[comp.lang.c] signal functions

chris@mimsy.UUCP (Chris Torek) (04/15/88)

[signal functions are called with three arguments in 4.[23]BSD:
    f(int signum, int code, struct sigcontext *scp)
]
>>Berkeley practice seems pretty firmly established to me.  What sort of
>>OS-centricism is going on here?

In article <1988Apr13.164012.513@utzoo.uucp> [love those message IDs]
henry@utzoo.uucp (Henry Spencer) writes:
>Berklocentrism, and it's you that's doing it.  Recent releases of x.yBSD
>are the *only* variants of Unix that interface to signal handlers in that
>way. ... on any machine that has trouble with varargs functions; the
>Berkloids have this wretchedly stupid habit of not giving new interfaces
>new names.  All the world's a VAX, right?  Grr.

Well, they do have that habit (`I argues and I argues and all I gets
is a tired jaw'), but in this case you are wrong.  Well, you are right
*and* wrong.  The true signal interface in 4.2/4.3BSD is the `sigvec'
system call; the `signal' interface is emulated in the C library.
That emulation could (but does not now, on the Vax and Tahoe, where
it happens to be unnecessary) arrange to call `signal' handlers
with only one argument, while `sigvec' handlers would get all three.

Moreover, while the second argument and third arguments are overly
Vaxish, something along the lines of the third, at least, is necessary
for doing decent signal handing in the first place.

They did give the new interface a new name, and the new interface is
useful.
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163)
Domain:	chris@mimsy.umd.edu	Path:	uunet!mimsy!chris

henry@utzoo.uucp (Henry Spencer) (04/17/88)

> ... The true signal interface in 4.2/4.3BSD is the `sigvec'
> system call; the `signal' interface is emulated in the C library.
> That emulation could (but does not now, on the Vax and Tahoe, where
> it happens to be unnecessary) arrange to call `signal' handlers
> with only one argument, while `sigvec' handlers would get all three.

Unfortunately, the current documentation (as published by Usenix)
specifies the three-argument form for both sigvec and signal, and at
first glance I see not even a mention of the one-argument form.
-- 
"Noalias must go.  This is           |  Henry Spencer @ U of Toronto Zoology
non-negotiable."  --DMR              | {ihnp4,decvax,uunet!mnetor}!utzoo!henry