File:  [CSRG BSD Unix] / 41BSD / cmd / ucbmail / Signal.c
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 16:12:53 2018 UTC (8 years, 1 month ago) by root
Branches: MAIN, BSD
CVS tags: HEAD, BSD41
BSD 4.1

#

#include <signal.h>

/*
 * The following is for systems with botched signal() system entries
 * which don't return the proper value for the previous signal.
 */

int	oldsigs[17];

int
(*Signal())(sig, spot)
	int spot;
{
	int ret;

	/* printf("Signal(%d, %.1o)\n", sig, spot); */
	if (sig < 1 || sig > 16)
		return(-1);
	ret = oldsigs[sig];
	oldsigs[sig] = (int) spot;
	signal(sig, spot);
	return(ret);
}

Siginit()
{
	register int i;

	for (i = 1; i < 17; i++) {
		oldsigs[i] = (int) signal(i, SIG_IGN);
		signal(i, (int (*)()) oldsigs[i]);
	}
}

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.