启用了POSIX_SPAWN_SETEXEC的posix_spawn

时间:2015-12-08 15:51:27

标签: c macos posix

OSX手册页说明posix_spawn系统调用中的 POSIX_SPAWN_SETEXEC 位:

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).

在致电posix_spawn()并启用posix_spawn()之后,任何人都知道常规posix_spawnattr_setflagsPOSIX_SPAWN_SETEXEC之间的区别究竟是什么?

1 个答案:

答案 0 :(得分:1)

设置POSIX_SPAWN_SETEXEC后,posix_spawn代替生成新流程,而不是像execve那样替换流程。