win32: copy the code from proc_open(), just leave the pipes stuff out.
By detached I mean - start and leave running.

for most unixes:

pid = fork();
if (pid == 0)
{
    close(0);
    close(1);
    close(2);

    // mask out SIGHUP signal - unfortunately I don't remember the
calls for unixes

    exec(...);
}
else if (pid == -1)
{
    // fail

    return -1;
}
else 
{
    return pid;
}

On Tue, 23 Nov 2004 01:52:41 -0500, Wez Furlong <[EMAIL PROTECTED]> wrote:
> On Tue, 23 Nov 2004 08:28:03 +0200, [EMAIL PROTECTED] <[EMAIL PROTECTED]> 
> wrote:
> > The bottom line, is that in PHP there is no simple and consistent
> > cross-platform way to create a detached child process.
> 
> > Being a system programmer, this shouldn't be too much of an obstacle
> > for me, but at this moment I'm thinking of the application programmers
> > which don't have an api to create detach processes.
> 
> Define what you mean by detached and provide an example (in C) of how
> to achieve it on all (well, most will do) unices without assuming the
> presence of utility apps like nohup.
> 
> Likewise for win32.
> 
> --Wez.
>

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to