首页 > 其他 > 详细

fcntl(fd, F_SETFD, FD_CLOEXEC)

时间:2020-12-24 17:05:41      阅读:67      评论:0      收藏:0      [点我收藏+]

摘自:https://blog.csdn.net/zhangqingsup/article/details/6668203?utm_medium=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-4.control&depth_1-utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-4.control

 fcntl(fd, F_SETFD, FD_CLOEXEC); // 这里设置为FD_CLOEXEC表示当程序执行exec函数时本fd将被系统自动关闭,表示不传递给exec创建的新进程, 如果设置为fcntl(fd, F_SETFD, 0);那么本fd将保持打开状态复制到exec创建的新进程中

fcntl(fd, F_SETFD, FD_CLOEXEC)

原文:https://www.cnblogs.com/LiuYanYGZ/p/14184921.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!