Question about socket calls

Corinna Vinschen
Mon May 31 21:10:00 GMT 1999

"Ashish C. Nagre" wrote:
> Hello,
> I am a new user of cygnus and am trying to port a UNIX application to NT
> 4.0
> My problem is as follows:
> [...]
>          if (ioctl(fd, SIOCGIFADDR, (char *)&ifr) < 0) {
> [...]
> It returns errno = 22 which means Invalid argument.
> SIOCGIFADDR has been defined by me as follows:
> #define IOC_INOUT       (IOC_IN) /* |IOC_OUT) */
> #define _IOWR(x, y, t) \
>         (IOC_INOUT|((((int)sizeof (t))&IOCPARM_MASK)<<16)|(x<<8)|y)
> #define SIOCGIFADDR     _IOWR('i', 13, struct ifreq)    /* get ifnet
> address */

If you create a new define for the request parameter of the ioctl call,
how should the underlying system know, what you want?

Or, in other words, the absence of this define in the asm/socket.h
file has the meaning, that this request is not available. Full stop.
Your define will not change this.

You are using the official b20.1 version, isn't it? In the meantime,
this request (and the requests SIOCGIFBRDADDR and SIOCGIFNETMASK)
are implemented in cygwin. Try the official 15-Jan-1999 snapshot in

	cygwin1-19990115.dll.gz  	(the dll itself)
	winsup-src-19990115.tar.gz	(contains sources and especially
					 the header files)

or try my patched version of the 23-Dec-1998 snapshot in

	cv_cygwin1.dll.tar.gz		(dll and headers)


new mail address:

Want to unsubscribe from this list?
Send a message to

More information about the Cygwin mailing list