* @param * * @return * */
| 182 | * |
| 183 | */ |
| 184 | int socket(int domain, int type, int protocol) |
| 185 | { |
| 186 | int rc; |
| 187 | |
| 188 | ANS_FD_DEBUG("socket create start , domain %d, type %d \n", domain, type); |
| 189 | |
| 190 | if ((inited == 0) || (AF_INET != domain) || (SOCK_STREAM != type && SOCK_DGRAM != type)) |
| 191 | { |
| 192 | rc = real_socket(domain, type, protocol); |
| 193 | ANS_FD_DEBUG("linux socket fd %d \n", rc); |
| 194 | |
| 195 | return rc; |
| 196 | } |
| 197 | |
| 198 | assert(inited); |
| 199 | rc = anssock_socket(domain, type, protocol); |
| 200 | |
| 201 | if(rc > 0) |
| 202 | rc += ANS_FD_BASE; |
| 203 | |
| 204 | ANS_FD_DEBUG("ans socket fd %d \n", rc); |
| 205 | return rc; |
| 206 | } |
| 207 | |
| 208 | /** |
| 209 | * @param |
no outgoing calls
no test coverage detected