-1

Let's say that at some point in my program I am using execv and the function ran successfully. Now my program has changed. What happened to it exactly? (Is all the memory get wiped automatically?)

fluter
  • 13,238
  • 8
  • 62
  • 100
LiorGolan
  • 355
  • 1
  • 4
  • 11
  • Possible duplicate of [Please explain exec() function and its family](http://stackoverflow.com/questions/4204915/please-explain-exec-function-and-its-family) – Dan Getz May 06 '16 at 20:03

1 Answers1

1

execve() does not return on success, and the text, data, bss, and stack of the calling process are overwritten by that of the program loaded.

That is to say, all data of current process will be gone, and the new program is loaded into memory, replacing the original process.

fluter
  • 13,238
  • 8
  • 62
  • 100