version 1.17.6.1, 2012/09/10 12:03:56
|
version 1.18.4.1, 2012/11/16 13:14:11
|
Line 641 io_gethostbyname(const char *psHost, u_short port, io_
|
Line 641 io_gethostbyname(const char *psHost, u_short port, io_
|
} |
} |
|
|
/* |
/* |
|
* io_addrcmp() - Compare network addresses |
|
* |
|
* @a = 1st address |
|
* @b = 2nd address |
|
* return: 0 is equal or !=0 is different |
|
*/ |
|
int |
|
io_addrcmp(io_sockaddr_t * __restrict a, io_sockaddr_t * __restrict b) |
|
{ |
|
if (a && b && a->sa.sa_family == b->sa.sa_family) |
|
switch (a->sa.sa_family) { |
|
case AF_LOCAL: |
|
return strcmp(a->sun.sun_path, b->sun.sun_path); |
|
case AF_INET: |
|
return memcmp(&a->sin.sin_addr, &b->sin.sin_addr, |
|
sizeof a->sin.sin_addr); |
|
case AF_INET6: |
|
return memcmp(&a->sin6.sin6_addr, &b->sin6.sin6_addr, |
|
sizeof a->sin6.sin6_addr); |
|
case AF_LINK: |
|
return memcmp(&a->sdl.sdl_data, &b->sdl.sdl_data, |
|
sizeof a->sdl.sdl_data); |
|
} |
|
|
|
return (int) !!(a - b); |
|
} |
|
|
|
/* |
* io_usleep() - usleep() replacement for ELWIX |
* io_usleep() - usleep() replacement for ELWIX |
* |
* |
* @usec = microseconds for sleep |
* @usec = microseconds for sleep |