[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: RFC socketpair
From: |
Bastien ROUCARIES |
Subject: |
Re: RFC socketpair |
Date: |
Tue, 19 Apr 2011 14:31:04 +0200 |
On Tue, Apr 19, 2011 at 2:08 PM, Bruno Haible <address@hidden> wrote:
> Hello Bastien,
>
>> I do not know how to replace the fork() on windows.
>
> It's replaced by doing a spawn to a separate program. Take for example the
> files
> modules/nonblocking-pipe-tests
> tests/test-nonblocking-pipe.sh
> tests/test-nonblocking-pipe-main.c
> tests/test-nonblocking-pipe-child.c
> that were committed in gnulib two days ago. The essential points are:
> - Use a separate program for the child process(es).
> - Use posix_spawnp on Unix, spawnvpe on native Windows to spawn the child
> process. (Our posix_spawnp does not yet work on mingw.)
> - You can pass command-line options and stdin, stdout to the child process;
> file descriptors > 2 cannot be passed to child processes on Windows, I
> think.
Not sure about the last point see
http://msdn.microsoft.com/en-us/library/ms683463(v=vs.85).aspx
And unfortunatly socketpair need fd process inherance, so sad :(
Bastien