1 2 3 4 5 6 7 8 9 10 11 12 13 14
#include <sys/types.h> #include <sys/socket.h> #include <unistd.h> #include "buffer.h" int buffer_unix_read(int fd,char *buf,unsigned int len) { return read(fd,buf,len); } int buffer_tcp_read(int fd,char *buf, unsigned int len) { return recv(fd, buf,len,0); }