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

3 7 月, 2012 by admin Leave a reply »

#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

Advertisement

发表回复

You must be logged in to post a comment.
鄂ICP备09027626号