Path: utzoo!mnetor!uunet!mcvax!botter!ark!maart From: maart@cs.vu.nl (Maarten Litmaath) Newsgroups: comp.unix.wizards Subject: Redirect Output in the Middle of a Program - Missing Feature Message-ID: <1242@ark.cs.vu.nl> Date: 2 May 88 21:53:12 GMT References: <13085@brl-adm.ARPA> <3571@gryphon.CTS.COM> <2841@cvl.umd.edu> <62@denali.UUCP> <670@esl.UUCP> <606@taux01.UUCP> Reply-To: maart@cs.vu.nl (Maarten Litmaath) Organization: VU Informatica, Amsterdam Lines: 31 Keywords: system call, C interface Summary: Don't bleat about signal(2) and kill(1,2), etc.: edit the kernel Right now it's impossible to redirect output while a program is running, by typing something like: % a.out [bla bla gnome hobgoblin... invisible stalker... Mount device busy] ^Z % bg > /etc/passwd % (To catch some signal from inside the program, etc. is not a general solution!) 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? -- South-Africa: |Maarten Litmaath @ Free U Amsterdam: revival of the Third Reich |maart@cs.vu.nl, mcvax!botter!ark!maart