23,120
社区成员
发帖
与我相关
我的任务
分享
int set_fl(int fd, int flags) /* flags are file status flags to turn on */
{
int val;
if((val = fcntl(fd, F_GETFL, 0)) < 0) {
RPT(RPT_ERR,"[tskIpRev] : fcntl F_GETFL error");
return -1;
}
val |= flags; /* turn on flags */
if(fcntl(fd, F_SETFL, val) < 0) {
RPT(RPT_ERR,"[tskIpRev] : fcntl F_SETFL error");
return -1;
}
return 0;
}