to use dup() in cygwin

Corinna Vinschen corinna-cygwin@cygwin.com
Fri Feb 21 17:14:00 GMT 2003


On Fri, Feb 21, 2003 at 10:01:17AM +0100, Fernando.Frutos.Martin@es.jazztel.com wrote:
> Hi! and sorry my english,
> I've a server in Linux and Unix and it works perfectly, but when I compile 
> the same code in Cygwin, it doesn`t send the data to the socket, I use the 
> dup() comand.
> this is part of the program what, I repeat, works well in linux and unix 
> (sun, HP) 
> 
> /*close the display exit and send it to the socket*/
> 
>     close(1);
>     iError=dup(iDescSock);
>     if (iError==-1)
>         {
>         return(EEXECCOM);
>         }
>     sprintf(pcComando,"EjecutarComando_VB.ksh.%s",pcNombreAux);
>     iError=system(pcComando);
>     if (iError==-1)
>         {
>         fprintf(stderr,"Error en llamada a ejecutar");
>         return(EEXECCOM);
>         }

Did you try to

- look if you get the expected file descriptor from dup?
- look which errno you get?
- run the application under strace?
- run the application under gdb?

After that and if you found that the problem is actually a Cygwin
problem, please write a *short* testcase which allows to reproduce
the problem and I';ll be happy to have a look into this issue.

Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Developer                                mailto:cygwin@cygwin.com
Red Hat, Inc.

--
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/



More information about the Cygwin mailing list