Solaris winsock support

Dan Kegel dank at
Sat Sep 8 11:13:23 CDT 2001

Robert Lunnon wrote:
> Looking about in the code WsControl grubs about in the /proc filesystem to
> get the names of, and count the number of network interfaces. Since /Proc
> only hosts processes on Solaris this constitutes a linux dependancy we don't
> need. Studying the ifconfig source gives another possibility instead which
> look like it may be more portable using ioctl SIOCGIFCONF on an arbitrary IP
> socket
> The return from this call is a structure containing the length of the reply
> buffer, which seems to contains an array of ifreq structures (one for each
> interface) which contains among other things the name of the interface. By
> dividing the size of the buffer by the size of the returned objects we know
> how many interfaces there are...
> Questions
> Anyone know if this is Is this workable ?
> Is this workable on linux, (I ask because I don't have linux and don't know
> linux ioctl implementation details)?

SIOCGIFCONF isn't in the Single Unix Spec, V2, but it does appear to be in Linux.
It also appears to be in Irix.  Looks like a widely used ioctl.

But note:
  SIOCGIFCONF is supported by netbsd, but is hard to use
  gotchas because size of reply larger than expected
  glibc supports SIOCGIFCONF, but not for down or virtual interfaces
  cygwin supports it (so we can run wine on cygwin on windows :-)

- Dan

"I have seen the future, and it licks itself clean." -- Bucky Katt

More information about the wine-devel mailing list