ssize_t send(int s, const void *buf, size_t len, int flags) { static ssize_t (*libc_send)(int s, const void *buf, size_t len, int flags); ssize_t rc; hook(send); if (autocork_needed(s)) set_pending_frames(s, len); rc = libc_send(s, buf, len, flags); check_qlen(s); return rc; }
ssize_t send (int fd, const void *buf, size_t n, int flags) { struct simptcp_socket* sock; #if __DEBUG__ printf("function %s called\n", __func__); #endif if (!is_simptcp_descriptor(fd)) { return libc_send(fd, buf, n, flags); } /* Here comes the code for the send related to simptcp */ sock=simptcp_entity.simptcp_socket_descriptors[fd]; return sock->socket_state->send(sock,buf,n,flags); }