mrdvlpr
mrdvlpr

Reputation: 556

posix_spawn with POSIX_SPAWN_SETEXEC enabled

OSX man page says about POSIX_SPAWN_SETEXEC bit in posix_spawn system call:

POSIX_SPAWN_SETEXEC
Apple Extension: If this bit is set, rather than returning to the caller,
posix_spawn(2) and posix_spawnp(2) will behave as a more featureful execve(2).

Anyone knows what exactly is the difference between a regular posix_spawn() and a posix_spawn() after a call to posix_spawnattr_setflags which enabled POSIX_SPAWN_SETEXEC?

Upvotes: 3

Views: 704

Answers (1)

fuz
fuz

Reputation: 93082

When POSIX_SPAWN_SETEXEC is set, instead of spawning a new process, posix_spawn replaces the process just as execve would do.

Upvotes: 3

Related Questions