lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

On Sat, Jan 14, 2006 at 09:00:59PM -0800, Chris Marrin wrote:
> Ok, I have looked at the descriptions of execvp() in win32 docs and the 
> Posix spec. Win32 says it creates a "child process" while Posix says it 
> "replaces the currently running process". I have trouble understanding 
> this. Does the calling process exit cleanly, or just cease to exist?

In POSIX, the program that invokes execve() is just instantly thrown
away by the OS.  It does not go through any sort of application-level
shutdown.  The OS will do some internal housekeeping such as removing
memory maps that were put in place by the old process.

There's no child process; the new program takes over with the same
process ID.  Some resources from the old program will be retained for
use by the new program.  For example a file that was open in the old
program will remain open and usable by the new program, unless the old
program set the file's close-on-exec flag.

                                                  -Dave Dodge