LWN.net Logo

posix_spawn is stupid as a system call

posix_spawn is stupid as a system call

Posted Nov 5, 2009 13:45 UTC (Thu) by madscientist (subscriber, #16861)
In reply to: posix_spawn is stupid as a system call by helge.bahmann
Parent article: Toward a smarter OOM killer

Exactly. The number of useful and important things you can, want, and need to do between a fork and an exec is far too great to make it one call, in all but the simplest cases. I had this _exact_ argument with a Windows API proponent who felt that fork+exec was crazy (not related to OOM issues, just having more than one call). But the number of flags and arguments you'd need to replicate that behavior is insane and you'd STILL run into situations where you can't do what you want.

Fork+exec definitely has its downsides in some of the technical implementation requirements, but from a higher level language perspective it's brilliant.


(Log in to post comments)

Copyright © 2012, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds