Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 (Tek) 9/28/84 based on 9/17/84; site azure.UUCP Path: utzoo!watmath!clyde!bonnie!akgua!whuxlm!whuxl!houxm!mtuxo!mtunh!mtung!mtunf!ariel!vax135!cornell!uw-beaver!tektronix!teklds!azure!stevesu From: stevesu@azure.UUCP (Steve Summit) Newsgroups: net.unix-wizards Subject: Re: "swapfd" (more unix ideas) Message-ID: <288@azure.UUCP> Date: Fri, 28-Jun-85 01:26:46 EDT Article-I.D.: azure.288 Posted: Fri Jun 28 01:26:46 1985 Date-Received: Sun, 23-Jun-85 03:18:33 EDT References: <6954@ucbvax.ARPA> <5687@utzoo.UUCP> Organization: Tektronix, Beaverton OR Lines: 22 > 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. I don't know if it's what the original submittor had in mind, but the reason I've thought a call like this would be neat is because you could use it to give a shell the ability to manipulate i/o "after the fact," just like job control lets you manipulate backgroundness/foregroundness "after the fact." Is that command taking too long? Type control-Z and background it. Don't want the output coming out asysynchronously? Well, I haven't thought of a syntax, but the idea is that you want to reconnect the standard output of the process to a file. It gets hard if the process in question has played with its file descriptors, like repoening file descriptor 1 as something else, or dup'ing file descriptor 1 to some other file descriptor and then using it there. It gets messy. Steve Summit tektronix!tekmdp!stevesu