Interesting. I think that it is best to use FD to write a temporary file and then execute it using a regular exec call.
You can use mkstemp to create a guaranteed unique file name. Then read the contents from the file descriptor and upload it to the temp file. Then use the name given to you by mkstemp in the exec call.
If for some reason you do not want to write a new file, I think that your only other option is to manually analyze the image of the exe file, load it into memory, and then call its main () function. This duplicates the many features that already exist in the OS, and I donβt think you want to do this. It will be difficult to do it right and it seems not worth the effort.
Soapbox
source share