makpipe.c
来自「<B>Digital的Unix操作系统VAX 4.2源码</B>」· C语言 代码 · 共 30 行
C
30 行
#ifndef lintstatic 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 bsd4_2 execl ("/bin/sh", "sh", "-i", 0); execl ("/usr/ucb/bin/sh", "sh", "-i", 0);#else execlp("/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]);}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?