ioctl() SOS -- Please help

Ashish C. Nagre ashishcn@cisco.com
Tue Jun 1 14:04:00 GMT 1999


Hello,
I was trying to debug (using gdb) the application that I am trying to
port from UNIX to NT.
I have made a strange observation, when the following call is made:
	
	ioctl(fd, SIOCGIFFLAGS, (char *)&ifr)

The value returned in the member ifr.ifr_ifru.ifru_flags is different
when I just run the executable compared to when I run it in the
debugger.
	ifr.ifr_ifru.ifru_flags = 34 (executable)
	ifr.ifr_ifru.ifru_flags = 99 (in gdb)
As a result, the following condition
	(ifr.ifr_ifru.ifru_flags & 0x1) ---> indicates that interface is up
always returns TRUE (correctly) in the gdb but returns FALSE
(erroneously) as the executable.
 Why are the flags returned with different values ?
Is there a bug in the command ?
Thanks for your help.


Regards,
Ashish

Corinna Vinschen wrote:
> 
> "Ashish C. Nagre" wrote:
> > [...]
> > My question is should I overwrite the cygwin1.dll with the new dll that
> > I got like you asked me to or should I copy it somewhere and just add
> > the new dll in the PATH (using set PATH etc.)
> 
> Overwrite it. To have more than one of this DLLs in the PATH is a
> no no!
> 
> > Because, even though now I have the dll and the source, I don't know how
> > to get my code which makes the ioctl() calls to work with these new
> > files.
> 
> After you have copied the new DLL over the old one, you only have to
> copy
> winsup/include/asm/socket.h to the according directory in your include
> path.
> 
> This would have been easier, if you had taken my DLL, which I mentioned
> in the first mail, too. It contains exactly the needed files.
> 
> Regards,
> Corinna
> 
> --
> new mail address:
> mailto:corinna@vinschen.de

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com



More information about the Cygwin mailing list