Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!gatech!hao!husc6!panda!teddy!jpn From: jpn@teddy.UUCP (John P. Nelson) Newsgroups: comp.unix.questions Subject: Re: Fork and Join, Pipe in C Message-ID: <4146@teddy.UUCP> Date: Mon, 29-Jun-87 11:08:25 EDT Article-I.D.: teddy.4146 Posted: Mon Jun 29 11:08:25 1987 Date-Received: Sat, 4-Jul-87 22:43:10 EDT References: <7737@brl-adm.ARPA> <1186@ius2.cs.cmu.edu> <8174@utzoo.UUCP> <21685@sun.uucp> <113@xyzzy.UUCP> <117@xyzzy.UUCP> Reply-To: jpn@teddy.UUCP (John P. Nelson) Organization: GenRad, Inc., Concord, Mass. Lines: 23 >There is a close analogy to fork(), exec(), and create_process() in >link(), unlink(), and rename(). ... some extra efficency can be added >by hinting to the kernel that an unlink() will follow the link() >(avoiding the necessity to change the link count and so on) by >introducing the system call vlink(). The situations are NOT analogous. One of the most common operations done between an fork and an exec is the modifications of the file descriptors. Tell me, with create_process, just how would you create an inter-process pipe? The standard code is: pipe(fds) if (fork() == 0) { dup2(fds[1], 1); close(fds[0]); close(fds[1]); exec(...); } close(fds[0]); Unless create_process allows for modification of the file descriptors, it will be of limited utility.