posix_spawn() as an actual system call
As a developer, there are always those projects when it is hard to find a way to go forward.
Drop the project for now and find another project, if only to rest your eyes and find yourself a new insight for the temporarily abandoned project.
This is how I embarked on posix_spawn() as an actual system call you will find in Oracle Solaris 11.4.
The original library implementation of posix_spawn() uses vfork(), but why care about the old address space if you are not going to use it?
Or, worse, stop all the other threads in the process and don't start them until exec succeeded or when you call exit()?