I need to create a unit of execution with a different PID, but does not acquire resources from the initial process (open files, memory, ...).
On Linux, clone
is used for this purpose. On other BSDs, rfork
. Is there a Mac OS equivalent?
Alternatively, standard execve
can be used to reset the process environment, but requires a name on the filesystem, which is suboptimal for my purposes. On Linux a memfd
can be created and used with execveat
. Is there a Mac OS equivalent?