[Linux]O_CLOEXEC 标志
2016-02-28 13:14
573 查看
http://stackoverflow.com/questions/1315382/closing-all-open-files-in-a-process
If your program will be calling
If your program will be calling
forkand
exec, you really should open all file descriptors with the
O_CLOEXECflag so you don't have to manually close them before
exec. You can also use
fcntlto add this flag after a file is opened, but that's subject to race conditions in multithreaded programs.
相关文章推荐
- 使用Eclipse编译运行MapReduce程序 Hadoop2.6.0_Ubuntu/CentOS
- linux内存管理之初始化zonelists
- linux之ifconfig命令
- linux 进入救援模式
- Linux正则表达式――扩展篇
- java 项目linux下写入文件权限777
- linux知识复习一
- linux删除文件后没有释放空间
- 《Linux内核分析》-X86汇编基础及实验总结
- Linux内核分析——汇编代码执行及堆栈变化
- Linux进程的查看和调度分别使用什么命令?
- OpenStack 部署总结之:在CentOS 6.5上使用RDO单机安装icehouse(Ml2+GRE)
- CentOS 7安装mysql
- Linux Mint (应用软件— 虚拟机:Virtualbox)
- 谈谈Linux打补丁的原理以及如何判别打补丁的错误 --- 从补丁学内核
- linux下为php添加iconv模块的方法
- linux下静态库编译使用复杂版
- 11款最棒的Linux数据恢复工具
- Android(Linux)线路规程的使用
- 监控 Linux 性能的 18 个命令行工具