Re: redirecting stderr to memory
ezanardi@noah.dfis.ull.es (Enrique Zanardi) wrote on 16.12.97 in <[🔎] Pine.LNX.3.96.971216114305.11509A-100000@noah.dfis.ull.es>:
> On Mon, 15 Dec 1997, Nicolás Lichtmaier wrote:
> > Uh? Why don't you just do...
> >
> > int p[2];
> > pipe(p);
> > if(!fork())
> > {
> > dup2(p[1],2);
> > exec...
> > }
> > /* now you can read the output from the p[0] file descriptor... */
> Memory penalty. As busybox and dinstall are linked together in this
> implementation, forking implies doubling the already big memory
> requirements. Perhaps we should implement a libbusybox.so ...
I don't think so. That's what virtual memory and copy-on-write are for. If
you fork() your program, you should only actually duplicate pages that are
written to by one of the sides (and the management stuff in the kernel, of
course).
Now, if you exec(), then libs come in handy.
MfG Kai
--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-devel-request@lists.debian.org .
Trouble? e-mail to templin@bucknell.edu .
Reply to: