s = socket(AF_INET, SOCK_STREAM, 0);
s = __socket(AF_INET, SOCK_STREAM, 0);
rresvport(alport)	int *alport;{	struct sockaddr_in sin;	int s;	sin.sin_family = AF_INET;	sin.sin_addr.s_addr = INADDR_ANY;	s = socket(AF_INET, SOCK_STREAM, 0);	if (s < 0)		return -1;	for (;;) {		sin.sin_port = htons((u_short)*alport);		if (bind(s, (struct sockaddr *)&sin, sizeof(sin)) >= 0)			return s;		if (errno != EADDRINUSE) {			(void)close(s);			return -1;		}		(*alport)--;		if (*alport == IPPORT_RESERVED/2) {			(void)close(s);			__set_errno (EAGAIN);		/* close */			return -1;		}	}}