error: call to '__creat_missing_mode' declared with attribute error
int fd;
fd=open("/data/data/tmp.txt", O_WRONLY|O_CREAT);
write(fd, prop_name, sizeof(prop_name));
close(fd);
ERROR:
In file included from hardware/libhardware/hardware.c:29:0:
In function 'open',
inlined from 'hw_get_module_by_class' at hardware/libhardware/hardware.c:175:3:
bionic/libc/include/fcntl.h:100:13: error: call to '__creat_missing_mode' declared with attribute error: called with O_CREAT, but missing mode
__creat_missing_mode(); // compile time error
SOLUTION:
fd=open("/data/data/tmp.txt", O_WRONLY|O_CREAT, 0666);
使用open函数时,如果在第二个参数中使用了 O_CREAT,就必须添加第三个参数:创建文件时赋予的初始权限。
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· Manus爆火,是硬核还是营销?
· 终于写完轮子一部分:tcp代理 了,记录一下
· 别再用vector<bool>了!Google高级工程师:这可能是STL最大的设计失误
· 单元测试从入门到精通