Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm Sender: cygwin-owner AT sourceware DOT cygnus DOT com Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com Message-ID: <374C9B43.36DAF3BE@vinschen.de> Date: Thu, 27 May 1999 03:09:23 +0200 From: Corinna Vinschen X-Mailer: Mozilla 4.51 [en] (WinNT; I) X-Accept-Language: de,en MIME-Version: 1.0 To: ashishcn AT cisco DOT com CC: cygwin AT sourceware DOT cygnus DOT com Subject: Re: Question about socket calls References: <374C73C0 DOT F8840BE6 AT cisco DOT com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit "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 ftp://sourceware.cygnus.com/pub/cygwin/snapshot-19990115/ named 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 ftp://ftp.franken.de/pub/win32/develop/gnuwin32/cygwin/porters/Vinschen_Corinna/B20 named cv_cygwin1.dll.README cv_cygwin1.dll.tar.gz (dll and headers) Regards, Corinna -- new mail address: mailto:corinna AT vinschen DOT de -- Want to unsubscribe from this list? Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com