"swapfd" (more unix ideas)

Steve Summit stevesu at azure.UUCP
Fri Jun 28 15:26:46 AEST 1985


> 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



More information about the Comp.unix.wizards mailing list