bzero (sin, sizeof (*sin));
__bzero (sin, sizeof (*sin));
bindresvport (int sd, struct sockaddr_in *sin){  int res;  static short port;  struct sockaddr_in myaddr;#ifndef errno  extern int errno;#endif  int i;#define STARTPORT 600#define ENDPORT (IPPORT_RESERVED - 1)#define NPORTS	(ENDPORT - STARTPORT + 1)  if (sin == (struct sockaddr_in *) 0)    {      sin = &myaddr;      bzero (sin, sizeof (*sin));      sin->sin_family = AF_INET;    }  else if (sin->sin_family != AF_INET)    {      __set_errno (EPFNOSUPPORT);      return -1;    }  if (port == 0)    {      port = (getpid () % NPORTS) + STARTPORT;    }  res = -1;  __set_errno (EADDRINUSE);  for (i = 0; i < NPORTS && res < 0 && errno == EADDRINUSE; i++)    {      sin->sin_port = htons (port++);      if (port > ENDPORT)	{	  port = STARTPORT;	}      res = bind (sd, sin, sizeof (struct sockaddr_in));    }  return res;}