close (fd);
__close (fd);
if_indextoname (unsigned int ifindex, char *ifname){#ifndef SIOGIFINDEX  __set_errno (ENOSYS);  return NULL;#else  struct if_nameindex *idx;  struct if_nameindex *p;  char *result = NULL;#ifdef SIOGIFNAME  /* We may be able to do the conversion directly, rather than searching a     list.  This ioctl is not present in kernels before version 2.1.50.  */  struct ifreq ifr;  int fd;  static int siogifname_works = 1;  if (siogifname_works)    {      int serrno = errno;      fd = opensock ();      if (fd < 0)	return NULL;      ifr.ifr_ifindex = ifindex;      if (ioctl (fd, SIOGIFNAME, &ifr) < 0)	{	  if (errno == EINVAL)	    siogifname_works = 0;   /* Don't make the same mistake twice. */	}      else	{	  close (fd);	  return strncpy (ifname, ifr.ifr_name, IFNAMSIZ);	}      close (fd);      __set_errno (serrno);    }#endif  idx = if_nameindex ();  if (idx != NULL)    {      for (p = idx; p->if_index || p->if_name; ++p)	if (p->if_index == ifindex)	  {	    result = strncpy (ifname, p->if_name, IFNAMSIZ);	    break;	  }      if_freenameindex (idx);    }  return result;#endif}