| 214 | |
| 215 | } |
| 216 | int socket(int domain, int type, int protocol) |
| 217 | { |
| 218 | HOOK_SYS_FUNC( socket ); |
| 219 | |
| 220 | if( !co_is_enable_sys_hook() ) |
| 221 | { |
| 222 | return g_sys_socket_func( domain,type,protocol ); |
| 223 | } |
| 224 | int fd = g_sys_socket_func(domain,type,protocol); |
| 225 | if( fd < 0 ) |
| 226 | { |
| 227 | return fd; |
| 228 | } |
| 229 | |
| 230 | rpchook_t *lp = alloc_by_fd( fd ); |
| 231 | lp->domain = domain; |
| 232 | |
| 233 | fcntl( fd, F_SETFL, g_sys_fcntl_func(fd, F_GETFL,0 ) ); |
| 234 | |
| 235 | return fd; |
| 236 | } |
| 237 | |
| 238 | int co_accept( int fd, struct sockaddr *addr, socklen_t *len ) |
| 239 | { |
no test coverage detected