(* func)(fred, bert)

David Goodenough dg at lakart.UUCP
Fri Nov 10 02:41:11 AEST 1989


dsr at stl.stc.co.uk (David Riches) sez:
> I want a function with the following interface, that does some actions
> when a signal activates it :-
> 
> VOID error(code, status)
 .....
 
> VOID main()
> 
>  {
>   signal(SIG_ALARM, error(101, &stat);		<----------------- (B)

You can do this quite easily, but it takes a global variable and
an additional procedure:

void error(code, status)
int code, *status;
 {
    etc.
 }

int stat;

void error101()
 {
    error(101, &stat);
 }

void main()
 {
    signal(SIG_ALARM, error101);

    etc.
 }
-- 
	dg at lakart.UUCP - David Goodenough		+---+
						IHS	| +-+-+
	....... !harvard!xait!lakart!dg			+-+-+ |
AKA:	dg%lakart.uucp at xait.xerox.com			  +---+



More information about the Comp.lang.c mailing list