This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]