Lines Matching refs:fd

45 int ff_hook_close(int fd)  in ff_hook_close()  argument
47 if (ff_fdisused(fd)) { in ff_hook_close()
48 return ff_close(fd); in ff_hook_close()
50 return mt_real_func(close)(fd); in ff_hook_close()
54 int ff_hook_connect(int fd, const struct sockaddr *address, socklen_t addrlen_len) in ff_hook_connect() argument
56 if (ff_fdisused(fd)) { in ff_hook_connect()
57 return ff_connect(fd, (struct linux_sockaddr *)address, addrlen_len); in ff_hook_connect()
59 return mt_real_func(connect)(fd, address, addrlen_len); in ff_hook_connect()
63 ssize_t ff_hook_read(int fd, void *buf, size_t nbyte) in ff_hook_read() argument
65 if (ff_fdisused(fd)) { in ff_hook_read()
66 return ff_read(fd, buf, nbyte); in ff_hook_read()
68 return mt_real_func(read)(fd, buf, nbyte); in ff_hook_read()
72 ssize_t ff_hook_write(int fd, const void *buf, size_t nbyte) in ff_hook_write() argument
74 if (ff_fdisused(fd)) { in ff_hook_write()
75 return ff_write(fd, buf, nbyte); in ff_hook_write()
77 return mt_real_func(write)(fd, buf, nbyte); in ff_hook_write()
80 ssize_t ff_hook_sendto(int fd, const void *message, size_t length, int flags, in ff_hook_sendto() argument
83 if (ff_fdisused(fd)) { in ff_hook_sendto()
84 return ff_sendto(fd, message, length, flags, (struct linux_sockaddr *)dest_addr, dest_len); in ff_hook_sendto()
86 return mt_real_func(sendto)(fd, message, length, flags, dest_addr, dest_len); in ff_hook_sendto()
89 ssize_t ff_hook_recvfrom(int fd, void *buffer, size_t length, int flags, in ff_hook_recvfrom() argument
92 if (ff_fdisused(fd)) { in ff_hook_recvfrom()
93 … return ff_recvfrom(fd, buffer, length, flags, (struct linux_sockaddr *)address, address_len); in ff_hook_recvfrom()
95 return mt_real_func(recvfrom)(fd, buffer, length, flags, address, address_len); in ff_hook_recvfrom()
98 ssize_t ff_hook_recv(int fd, void *buffer, size_t length, int flags) in ff_hook_recv() argument
100 if (ff_fdisused(fd)) { in ff_hook_recv()
101 return ff_recv(fd, buffer, length, flags); in ff_hook_recv()
103 return mt_real_func(recv)(fd, buffer, length, flags); in ff_hook_recv()
106 ssize_t ff_hook_send(int fd, const void *buf, size_t nbyte, int flags) in ff_hook_send() argument
108 if (ff_fdisused(fd)) { in ff_hook_send()
109 return ff_send(fd, buf, nbyte, flags); in ff_hook_send()
111 return mt_real_func(send)(fd, buf, nbyte, flags); in ff_hook_send()
115 int ff_hook_setsockopt(int fd, int level, int option_name, const void *option_value, socklen_t opti… in ff_hook_setsockopt() argument
117 if (ff_fdisused(fd)) { in ff_hook_setsockopt()
118 return ff_setsockopt(fd, level, option_name, option_value, option_len); in ff_hook_setsockopt()
120 return mt_real_func(setsockopt)(fd, level, option_name, option_value, option_len); in ff_hook_setsockopt()
124 int ff_hook_ioctl(int fd, int cmd, void *arg) in ff_hook_ioctl() argument
126 if (ff_fdisused(fd)) { in ff_hook_ioctl()
127 return ff_ioctl(fd, cmd, arg); in ff_hook_ioctl()
129 return mt_real_func(ioctl)(fd, cmd, arg); in ff_hook_ioctl()
133 int ff_hook_fcntl(int fd, int cmd, void *arg) in ff_hook_fcntl() argument
135 if (ff_fdisused(fd)) { in ff_hook_fcntl()
136 return ff_fcntl(fd, cmd, arg); in ff_hook_fcntl()
138 return mt_real_func(fcntl)(fd, cmd, arg); in ff_hook_fcntl()
142 int ff_hook_listen(int fd, int backlog) in ff_hook_listen() argument
144 if (ff_fdisused(fd)) { in ff_hook_listen()
145 return ff_listen(fd, backlog); in ff_hook_listen()
147 return mt_real_func(listen)(fd, backlog); in ff_hook_listen()
151 int ff_hook_bind(int fd, const struct sockaddr *addr, socklen_t addrlen) in ff_hook_bind() argument
153 if (ff_fdisused(fd)) { in ff_hook_bind()
154 return ff_bind(fd, (struct linux_sockaddr *)addr, addrlen); in ff_hook_bind()
156 return mt_real_func(bind)(fd, addr, addrlen); in ff_hook_bind()
160 int ff_hook_accept(int fd, struct sockaddr *addr, socklen_t *addrlen) in ff_hook_accept() argument
162 if (ff_fdisused(fd)) { in ff_hook_accept()
163 return ff_accept(fd, (struct linux_sockaddr *)addr, addrlen); in ff_hook_accept()
165 return mt_real_func(accept)(fd, addr, addrlen); in ff_hook_accept()