version 1.1.1.1, 2012/02/21 16:42:02
|
version 1.1.1.2, 2012/10/09 09:13:23
|
Line 1
|
Line 1
|
/* |
/* |
* Copyright (C) 2008-2010 Daisuke Aoyama <aoyama@peach.ne.jp>. | * Copyright (C) 2008-2012 Daisuke Aoyama <aoyama@peach.ne.jp>. |
* All rights reserved. |
* All rights reserved. |
* |
* |
* Redistribution and use in source and binary forms, with or without |
* Redistribution and use in source and binary forms, with or without |
Line 54
|
Line 54
|
#define AI_NUMERICSERV 0 |
#define AI_NUMERICSERV 0 |
#endif |
#endif |
|
|
|
#if !defined(__GNUC__) |
|
#undef __attribute__ |
|
#define __attribute__(x) |
|
#endif |
|
|
int |
int |
istgt_getaddr(int sock, char *saddr, int slen, char *caddr, int clen) |
istgt_getaddr(int sock, char *saddr, int slen, char *caddr, int clen) |
{ |
{ |
Line 68 istgt_getaddr(int sock, char *saddr, int slen, char *c
|
Line 73 istgt_getaddr(int sock, char *saddr, int slen, char *c
|
return -1; |
return -1; |
} |
} |
rc = getnameinfo((struct sockaddr *) &sa, salen, |
rc = getnameinfo((struct sockaddr *) &sa, salen, |
saddr, slen, NULL, 0, NI_NUMERICHOST); | saddr, slen, NULL, 0, NI_NUMERICHOST); |
if (rc != 0) { |
if (rc != 0) { |
return -1; |
return -1; |
} |
} |
Line 80 istgt_getaddr(int sock, char *saddr, int slen, char *c
|
Line 85 istgt_getaddr(int sock, char *saddr, int slen, char *c
|
return -1; |
return -1; |
} |
} |
rc = getnameinfo((struct sockaddr *) &sa, salen, |
rc = getnameinfo((struct sockaddr *) &sa, salen, |
caddr, clen, NULL, 0, NI_NUMERICHOST); | caddr, clen, NULL, 0, NI_NUMERICHOST); |
if (rc != 0) { |
if (rc != 0) { |
return -1; |
return -1; |
} |
} |
Line 339 can_write_socket(int s, int msec)
|
Line 344 can_write_socket(int s, int msec)
|
} |
} |
#endif /* USE_POLLWAIT */ |
#endif /* USE_POLLWAIT */ |
|
|
|
#ifdef USE_POLLWAIT |
|
#define UNUSED_POLLWAIT(x) x |
|
#else |
|
#define UNUSED_POLLWAIT(x) x __attribute__((__unused__)) |
|
#endif |
|
|
ssize_t |
ssize_t |
istgt_read_socket(int s, void *buf, size_t nbytes, int timeout) | istgt_read_socket(int s, void *buf, size_t nbytes, int UNUSED_POLLWAIT(timeout)) |
{ |
{ |
ssize_t n; |
ssize_t n; |
#ifdef USE_POLLWAIT |
#ifdef USE_POLLWAIT |
Line 387 istgt_read_socket(int s, void *buf, size_t nbytes, int
|
Line 398 istgt_read_socket(int s, void *buf, size_t nbytes, int
|
} |
} |
|
|
ssize_t |
ssize_t |
istgt_write_socket(int s, const void *buf, size_t nbytes, int timeout) | istgt_write_socket(int s, const void *buf, size_t nbytes, int UNUSED_POLLWAIT(timeout)) |
{ |
{ |
ssize_t n; |
ssize_t n; |
#ifdef USE_POLLWAIT |
#ifdef USE_POLLWAIT |