execve() and more memory related questions
Posted: Sun Jul 09, 2006 9:42 am
Hi all
I've been tinkering with my execve() syscall, and have a couple of questions..
in the man page for execve() it says that all the text data and bss are over written with the new task's image, but what about the memory that has been allocated dynamically?
I assumed that execve would require a freshly cleaned address space for the new program, and went about programming such a function and couldn't get it to work.
Thinking about it, is clearing the memory really an issue? If I reset the current "memory allocated" thing to 0, the allocater will just allocate pages again, and if it has stuff in it, well clearing that is the job of the program (or allocater)?
Am I right in thinking that I only need to clear the memory when the task is finished?
I've been tinkering with my execve() syscall, and have a couple of questions..
in the man page for execve() it says that all the text data and bss are over written with the new task's image, but what about the memory that has been allocated dynamically?
I assumed that execve would require a freshly cleaned address space for the new program, and went about programming such a function and couldn't get it to work.
Thinking about it, is clearing the memory really an issue? If I reset the current "memory allocated" thing to 0, the allocater will just allocate pages again, and if it has stuff in it, well clearing that is the job of the program (or allocater)?
Am I right in thinking that I only need to clear the memory when the task is finished?