File:  [Power 6/32 Unix Tahoe 4.2BSD] / cci / usr / src / usr.bin / learn / makpipe.c
Revision 1.1.1.2 (vendor branch): download - view: text, annotated - select for diffs
Sun Jul 28 12:26:14 2019 UTC (6 years, 11 months ago) by root
Branches: bsd, MAIN
CVS tags: v121, HEAD
Power 6/32 Unix version 1.21

#ifndef lint
static char sccsid[] = "@(#)makpipe.c	4.2	(Berkeley)	4/25/83";
#endif not lint

#include "stdio.h"

makpipe()
{
	int f[2];

	pipe(f);
	if (fork()==0) {
		close(f[1]);
		close(0);
		dup(f[0]);
		close(f[0]);
/* #if vax */
		execl ("/bin/sh", "sh", "-i", 0);
		execl ("/usr/ucb/bin/sh", "sh", "-i", 0);
/* #else */
/* 		execl("/bin/csh", "csh", "-if", 0);         */
/*		execl("/usr/ucb/bin/csh", "csh", "-if", 0); */
/* #endif */
		write(2, "Exec error\n", 11);
	}
	close(f[0]);
	sleep(2);	/* so shell won't eat up too much input */
	return(f[1]);
}

unix.superglobalmegacorp.com

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