Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!henry From: henry@utzoo.UUCP (Henry Spencer) Newsgroups: net.unix-wizards Subject: Re: more unix ideas Message-ID: <5687@utzoo.UUCP> Date: Mon, 17-Jun-85 12:03:11 EDT Article-I.D.: utzoo.5687 Posted: Mon Jun 17 12:03:11 1985 Date-Received: Mon, 17-Jun-85 12:03:11 EDT References: <6954@ucbvax.ARPA> Organization: U of Toronto Zoology Lines: 25 > 1) have a swapfd system call > Usage: swapfd(fd1,proc,fd2) > or possibly: swapfd(proc1,fd1,proc2,fd2) > > what this does, is makes procs (usually another process) fd2, to become > my fd1, and my fd1 to become (point to a file structure) of procs fd2. Dennis Ritchie has implemented a nicer version of this in V8: you can send file descriptors across pipes. This does require the cooperation of the other process, which is an advantage or a disadvantage depending on what you are doing. > 2) have another version of the exit sytem call, > which will just cause the parents wait to return, > without the process really exiting. > This so that a process could put itself in background. This is trivial to do in standard Unix; just have the child process fork a new child, and then exit. (Remember that a child of a dead process does not become a child of the deceased's parent, it becomes an orphan.) This has been used in things like daemons since time immemorial (i.e. 1974 or earlier!). -- Henry Spencer @ U of Toronto Zoology {allegra,ihnp4,linus,decvax}!utzoo!henry