存档在 2012年7月3日

sendfile函数在Linux/FreeBSD下的使用区别

2012年7月3日

#if HGL_OS == HGL_OS_Linux
#include<sys/sendfile.h>

inline int sendfile(int tfd,int sfd,size_t size)
{
return sendfile(tfd,sfd,NULL,size);
}
#endif//HGL_OS == HGL_OS_Linux

#if HGL_OS == HGL_OS_FreeBSD
#include<sys/uio.h>

inline int sendfile(int tfd,int sfd,size_t size)
{
return sendfile(tfd,sfd,0,size,NULL,NULL,0);
}
#endif//HGL_OS == HGL_OS_FreeBSD

鄂ICP备09027626号