This is the mail archive of the cygwin@sourceware.cygnus.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]

Problem: Exec seems to close all file handles


Hello,

I have been working with the execv() call in a cygwin32 application, and
have discovered that, when executing a non-cygwin32 app, apparently all the
IO channels are closed when the application is initialized. This is my
guess, but let me explain what I am trying to do. Incidentally, this problem
does not seem to occur in programs that have been compiled with the cygwin32
stuff (gcc, etc). Basically, I have used dup2 to copy some file handles to
sockets, so that the standard IO is redirected in/out of sockets. As soon as
the server (which performs this redirection) executes the new program with
execv(), the client (who is listening on the sockets) gets a message that
the socket has been closed, and exits. This does not happen with
applications that have been written with cygwin32, but it does happen with
anything else (ftp.exe for example). Does anyone know what Windows Console
apps do when they start up? I am running 19.1 on NT 4.0, with egcs 1.0.2 and
the latest coolview (July 18, I think). If anyone wants more information,
let me know. Thanks in advance for the help...

Peter Mularski

-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".


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