posixspawn
Posix_spawn is a POSIX standard API for creating new processes. It provides a single, high-level interface to start a program and is designed as a safer and potentially more efficient alternative to the traditional fork followed by exec. The API is implemented on many Unix-like systems and in standard C libraries.
Two forms exist: posix_spawn and posix_spawnp. posix_spawn uses an explicit path to the executable, while posix_spawnp
int posix_spawn(pid_t *restrict pid, const char *restrict path, const posix_spawn_file_actions_t *restrict file_actions, const posix_spawn_attr_t *restrict attrp,
int posix_spawnp(pid_t *restrict pid, const char *restrict file, const posix_spawn_file_actions_t *restrict file_actions, const posix_spawn_attr_t *restrict attrp,
The file_actions and attrp parameters describe actions and attributes for the new process. File actions may
Return values: On success, posix_spawn stores the child process ID in *pid (when pid is non-null) and
Portability and usage: posix_spawn is mandated by POSIX, but actual support varies by system. Some platforms