if (ioctl (sock, SIOCGIFFLAGS, (char *) &ifreq) < 0)
if (__ioctl (sock, SIOCGIFFLAGS, (char *) &ifreq) < 0)
getbroadcastnets (struct in_addr *addrs, int sock, char *buf)  /* int sock:  any valid socket will do */  /* char *buf:	why allocate more when we can use existing... */{  struct ifconf ifc;  struct ifreq ifreq, *ifr;  struct sockaddr_in *sin;  int n, i;  ifc.ifc_len = UDPMSGSIZE;  ifc.ifc_buf = buf;  if (ioctl (sock, SIOCGIFCONF, (char *) &ifc) < 0)    {      perror (_("broadcast: ioctl (get interface configuration)"));      return (0);    }  ifr = ifc.ifc_req;  for (i = 0, n = ifc.ifc_len / sizeof (struct ifreq); n > 0; n--, ifr++)    {      ifreq = *ifr;      if (ioctl (sock, SIOCGIFFLAGS, (char *) &ifreq) < 0)	{	  perror (_("broadcast: ioctl (get interface flags)"));	  continue;	}      if ((ifreq.ifr_flags & IFF_BROADCAST) &&	  (ifreq.ifr_flags & IFF_UP) &&	  ifr->ifr_addr.sa_family == AF_INET)	{	  sin = (struct sockaddr_in *) &ifr->ifr_addr;#ifdef SIOCGIFBRDADDR		/* 4.3BSD */	  if (ioctl (sock, SIOCGIFBRDADDR, (char *) &ifreq) < 0)	    {	      addrs[i++] = inet_makeaddr (inet_netof	      /* Changed to pass struct instead of s_addr member	         by roland@gnu.  */					  (sin->sin_addr), INADDR_ANY);	    }	  else	    {	      addrs[i++] = ((struct sockaddr_in *)			    &ifreq.ifr_addr)->sin_addr;	    }#else /* 4.2 BSD */	  addrs[i++] = inet_makeaddr (inet_netof				      (sin->sin_addr.s_addr), INADDR_ANY);#endif	}    }  return i;}