游戏开发论坛

 找回密码
 立即注册
搜索
查看: 3711|回复: 0

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

[复制链接]

2万

主题

2万

帖子

6万

积分

论坛元老

Rank: 8Rank: 8

积分
66484
QQ
发表于 2012-7-4 13:17:00 | 显示全部楼层 |阅读模式
#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备17032699号-3 )

GMT+8, 2024-5-2 19:17

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表