This is the mail archive of the
cygwin@cygwin.com
mailing list for the Cygwin project.
Socket inheritance problem across exec.
- From: Toft <toft at itvd dot sel dot sony dot com>
- To: cygwin at cygwin dot com
- Date: Wed, 05 Jun 2002 15:46:34 -0700
- Subject: Socket inheritance problem across exec.
Hello,
I have a problem with keeping the redirecting of stdout to a socket
accross an exec() call.
I'm doing the following :
- Create a socket connection.
- Fork a child process
- Use dup2 to redirect stdout to the socket
- execle() the new process.
I expect the new process to redirect stdout to the inherited socket.
When I compile the program I'm exec'ing under cygwin this works
well - the called program redirects stdout to the socket.
When I compile the program I'm exec'ing with for instance a Borland
compiler I get no output whatsoever after the exec.
If I redirect stdout to a file, rather than a socket, both cases work
fine.
Is there any particular known problems with inheriting sockets over
exec ?
I checked - the FD_CLOEXEC flag is set correctly before the exec.
I'm ran this on both 98 & 2000 with same results. I just upgraded
to latest 1.3.10 release.
Rolf
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/