| 191 | } |
| 192 | |
| 193 | ssize_t write(int fd, const void *buf, size_t nbyte) |
| 194 | { |
| 195 | mt_hook_syscall(write); |
| 196 | MtHookFd* hook_fd = mt_hook_find_fd(fd); |
| 197 | if (!mt_hook_active() || !hook_fd || !ff_hook_active()) |
| 198 | { |
| 199 | return mt_real_func(write)(fd, buf, nbyte); |
| 200 | } |
| 201 | |
| 202 | if (hook_fd->sock_flag & MT_FD_FLG_UNBLOCK) |
| 203 | { |
| 204 | return ff_hook_write(fd, buf, nbyte); |
| 205 | } |
| 206 | |
| 207 | return MtFrame::write(fd, buf, nbyte, hook_fd->write_timeout); |
| 208 | } |
| 209 | |
| 210 | ssize_t sendto(int fd, const void *message, size_t length, int flags, |
| 211 | const struct sockaddr *dest_addr, socklen_t dest_len) |