Re: fork()/exec() and X11 streams usage.
Re: fork()/exec() and X11 streams usage.
- Subject: Re: fork()/exec() and X11 streams usage.
- From: Jeremy Huddleston Sequoia <email@hidden>
- Date: Fri, 12 Oct 2012 00:11:51 -0700
On Oct 11, 2012, at 21:36, James K. Lowden <email@hidden> wrote:
> On Mon, 08 Oct 2012 18:43:33 -0700
> Jeremy Huddleston Sequoia <email@hidden> wrote:
>
>> You should really use posix_spawn instead of fork/exec unless you
>> really need to do something "special" pre-exec.
>
> Why? posix_spawn *is* fork + exec; combining them yielded an
> ungainly, less composable function.
No. posix_spawn is more efficient. At base, it's a single syscall instead of at-least 2. Beyond that, it allows the kernel to skip some possibly unnecessary action in setting up the new process... For example CLOEXEC fds would be created for the new process only to be destroyed on the subsequent exec...
--Jeremy
_______________________________________________
Do not post admin requests to the list. They will be ignored.
X11-users mailing list (email@hidden)
This email sent to email@hidden