equal
deleted
inserted
replaced
79 |
79 |
80 #ifdef __solaris__ |
80 #ifdef __solaris__ |
81 rv = connect(fd, 0, 0); |
81 rv = connect(fd, 0, 0); |
82 #endif |
82 #endif |
83 |
83 |
84 #if defined(__linux__) || defined(_ALLBSD_SOURCE) |
84 #if defined(__linux__) || defined(_ALLBSD_SOURCE) || defined(_AIX) |
85 { |
85 { |
86 int len; |
86 int len; |
87 SOCKADDR sa; |
87 SOCKADDR sa; |
88 |
88 |
89 memset(&sa, 0, sizeof(sa)); |
89 memset(&sa, 0, sizeof(sa)); |
111 |
111 |
112 rv = connect(fd, (struct sockaddr *)&sa, len); |
112 rv = connect(fd, (struct sockaddr *)&sa, len); |
113 |
113 |
114 #if defined(_ALLBSD_SOURCE) |
114 #if defined(_ALLBSD_SOURCE) |
115 if (rv < 0 && errno == EADDRNOTAVAIL) |
115 if (rv < 0 && errno == EADDRNOTAVAIL) |
|
116 rv = errno = 0; |
|
117 #endif |
|
118 #if defined(_AIX) |
|
119 /* See W. Richard Stevens, "UNIX Network Programming, Volume 1", p. 254: |
|
120 * 'Setting the address family to AF_UNSPEC might return EAFNOSUPPORT |
|
121 * but that is acceptable. |
|
122 */ |
|
123 if (rv < 0 && errno == EAFNOSUPPORT) |
116 rv = errno = 0; |
124 rv = errno = 0; |
117 #endif |
125 #endif |
118 } |
126 } |
119 #endif |
127 #endif |
120 |
128 |