| 121 | } |
| 122 | |
| 123 | int socket(int domain, int type, int protocol) |
| 124 | { |
| 125 | mt_hook_syscall(socket); |
| 126 | |
| 127 | if (!ff_hook_active()) |
| 128 | { |
| 129 | return mt_real_func(socket)(domain, type, protocol); |
| 130 | } |
| 131 | |
| 132 | int fd = ff_hook_socket(domain, type, protocol); |
| 133 | if (fd < 0) |
| 134 | { |
| 135 | return fd; |
| 136 | } |
| 137 | |
| 138 | mt_hook_new_fd(fd); |
| 139 | |
| 140 | mt_hook_syscall(ioctl); |
| 141 | int nb = 1; |
| 142 | ff_hook_ioctl(fd, FIONBIO, &nb); |
| 143 | |
| 144 | return fd; |
| 145 | } |
| 146 | |
| 147 | int close(int fd) |
| 148 | { |
no test coverage detected