Re: evecv/memory leak



bill pursell wrote:

> int
> main(int ac, char **av)
> {
> process_stuff();
> execv(av[0],av);
> }
>
> The question is: is this identical to killing the process and
> restarting?

No. process_stuff() can open more file descriptors each time,
change the current directory, etc., and mere execv() does
not "reset" those. But execve() does reset the address space.

--
.



Relevant Pages

  • memory leak (definition?)
    ... main(int ac, char **av) ... char *buf; ... a state that is clearly unhappy, and killing the process ... equivalent to killing the process and restarting ...
    (comp.lang.c)
  • Re: Bulldog UPS
    ... This appears to reset ... the USB device by shutting down the current device, and restarting it on a ...
    (alt.os.linux.suse)
  • Re: Eliza Dushku in Dollhouse on Sky!
    ... the reset button, yet regularly used it when killing off major characters ... But in any case, in a show about *killing* vampires, Angel and Spike ...
    (uk.media.tv.misc)
  • Re: Eliza Dushku in Dollhouse on Sky!
    ... the reset button, yet regularly used it when killing off major characters ... But in any case, in a show about *killing* vampires, Angel and Spike ... Or how, knowing full well Spike was joining Angel, still played out his 'death' for everything it could manage. ...
    (uk.media.tv.misc)
  • [PATCH 11/13] drivers/block/floppy.c: Add function is_ready_state
    ... static int set_dor(int fdc, char mask, char data) ... -/* reset all driver information about the current fdc. ...
    (Linux-Kernel)