What do you want in a signal library?

Doug Gwyn gwyn at smoke.BRL.MIL
Thu Jan 18 02:02:44 AEST 1990


In article <20926 at stealth.acf.nyu.edu> brnstnd at stealth.acf.nyu.edu (Dan Bernstein) writes:
>On the same subject: How does one correctly code ANSI C raise() so as to
>prevent race conditions? I want to make sure I'm not messing this up.

/*
	raise() -- send a signal to the current process

	public-domain implementation

	last edit:	16-Jan-1990	Gwyn at BRL.MIL

	complies with the following standards:
		ANSI X3.159-1989
		IEEE Std 1003.1-1988
		SVID Issue 3
 */

extern int	getpid(), kill();	/* UNIX/POSIX system calls */

int
raise(sig)
	int	sig;
	{
	return kill(getpid(), sig);	/* set errno to EINVAL if sig invalid */
	}



More information about the Comp.unix.wizards mailing list