File:  [Research Unix] / researchv10no / games / trek / shell.c
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 17:21:35 2018 UTC (8 years, 1 month ago) by root
Branches: belllabs, MAIN
CVS tags: researchv10, HEAD
researchv10 Norman

#include "trek.h"
/**
 **	call the shell
 **/

shell()
{
	int		i;
	register int	pid;
	register int	oldsig, oldqit;

	if (!(pid = fork()))
	{
		setuid(getuid());
		nice(0);
		signal(SIGINT, 0);
		execl("/bin/sh", "-", 0);
		syserr("cannot execute /bin/sh");
	}
	oldsig=signal(2,1); oldqit=signal(3,1);
	while (wait(&i) != pid) ;
	printf("trek!\n");
	signal(2,oldsig); signal(3,oldqit);
}

unix.superglobalmegacorp.com

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