Redirect Output in the Middle of a Program - Missing Feature

Michael I. Bushnell mike at turing.UNM.EDU
Thu May 5 18:06:33 AEST 1988


In article <1242 at ark.cs.vu.nl> maart at cs.vu.nl (Maarten Litmaath) writes:

>There should be some system call to indicate that some stream of a child
>is to be reopened. The indication will probably be some kind of signal.
>The C interface could be something like:
>
>	int	redirect(pid, fd, file)
>	int	pid, fd;
>	char	*file;
>
>to connect file descriptor fd to file, and
>
>	int	dup3(pid, fd, newfd)
>	int	pid, fd, newfd;
>
>to make file descriptor fd a duplicate of newfd.
>In my opinion the UNIX kernel data structures are suited for these ideas.
>Am I blundering about, forgetting something important, or why haven't
>they been implemented yet?

Sigh.  This is real hard to do for the same reason fixing vhangup is
hard.  The file descriptors are in the processes u. area, and are thus
unavailable to the parent when it executes the system call.  Signal
delivery faces the same problem, and is solved by a hack in the swapin
code.  


                N u m q u a m   G l o r i a   D e o 

			Michael I. Bushnell
			HASA - "A" division
14308 Skyline Rd NE				Computer Science Dept.
Albuquerque, NM  87123		OR		Farris Engineering Ctr.
	OR					University of New Mexico
mike at turing.unm.edu				Albuquerque, NM  87131
{ucbvax,gatech}!unmvax!turing.unm.edu!mike



More information about the Comp.unix.wizards mailing list