Mailing-List: contact cygwin-help@sourceware.cygnus.com; run by ezmlm
Sender: cygwin-owner@sourceware.cygnus.com
Delivered-To: mailing list cygwin@sourceware.cygnus.com
Message-ID: <374C93CB.54BAD584@cisco.com>
Date: Wed, 26 May 1999 17:37:31 -0700
From: "Ashish C. Nagre" <ashishcn@cisco.com>
Reply-To: ashishcn@cisco.com
Organization: Cisco Systems
X-Mailer: Mozilla 4.03 [en] (WinNT; U)
MIME-Version: 1.0
To: "Suhaib M. Siddiqi" <ssiddiqi@ipass.net>
CC: "Ashish C. Nagre" <nagreac@cs.purdue.edu>, cygwin@sourceware.cygnus.com
Subject: Re: ioctl() question - SLIGHT CHANGE
References: <Pine.GSO.4.05.9905261914470.13492-100000@lisa.cs.purdue.edu> <374C928B.AB301B0D@ipass.net>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

> "Ashish C. Nagre" wrote:
> >
> > Hi,
> > I was trying to port an app from UNIX to NT, one of the things that needs
> > to be done is to get the interface addresses associated with the machine.
> > It does that using the following call:
> >
> >         ioctl(fd, SIOCGIFADDR, (char*)&ifr)
> >         where,
> >         fd - is a socket
> >         ifr - is a struct ifreq.
> > The function returns an error saying Invalid Argument.
> > Actually, SIOCGIFADDR was not defined with cygwin, so I added the
> > following also:
> >
> >         /* Just a definition of a macro which was not with cygnus; */
> > /* so the compiler doesn't complain.                                    */
> > #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     _IOR('i', 13, struct ifreq)    /* get ifnet
> > address */

That should read as _IOWR instead of _IOR.


> >
> > I would greatly appreciate it if you could help me out since I am stuck on
> > this for a long time and have no clue about how to go about this.
> > Thanks for your time.
> >
> > Ashish
> >
> > **************************************************************************
> > ASHISH C. NAGRE                             Graduate Student
> > Department of Computer Sciences             e-mail: nagreac@cs.purdue.edu
> > Purdue University,W. Lafayette              Phone : (765)-494-5007
> > Indiana, 47906. USA                         Office: MA 407
> > url : www.cs.purdue.edu/people/nagreac
> > **************************************************************************
> >                        :PHILOSOPHY OF LIFE:
> > Stability without boredom; passion without recklessness; happiness
> > without naivete. Plan for sunshine but bring an umbrella.  A little
> > paranoia never hurt anyone. Underpromise and overdeliver.
> > ---------------------------------------------------------------------------
> 
> --
> Want to unsubscribe from this list?
> Send a message to cygwin-unsubscribe@sourceware.cygnus.com

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

