c - 通过 open(const char *filename, int flags[, mode_t mode]) 函数查找文件描述符返回的模式
问题描述
在编译带有-O1
或更大标志的 C 程序时,编译器给出错误call to '__open_missing_mode' declared with attribute error: open with O_CREAT or O_TMPFILE in second argument needs 3 arguments
。
从互联网上搜索我发现 Open 必须需要通过mode_t
选项O_CREAT
。open
如何找到之前以 2 arg 函数返回的文件描述符的默认模式。
解决方案
推荐阅读
- mysql - mysql 字段 'col1' 没有默认值
- python - pandas DataFrame 中列中字符串的一种热编码
- xml - 通过 XSLT 在两个自闭标签之间选择文本
- rcpp - 从给定包中调用函数使用 RcppArmadillo(Rcpp)
- javascript - 如何强制一个带有嵌套 if 语句的代码块在 node.js 中的后续代码之前完成?
- pentaho - 以特定格式导入日期列
- javascript - Javascript 将选项卡置于最前面
- dart - Dart - 使用 Map 的嵌套类
- java - Mac 上的 MVN 权限被拒绝
- java - ArrayList 是可以用作 SRP 原则示例的实现吗?