当前位置:网站首页>JNI中使用open打开文件是返回-1问题
JNI中使用open打开文件是返回-1问题
2022-04-23 06:08:00 【Johnny2004】
fd = open("/dev/test", O_RDWR|O_NOCTTY/*|O_NDELAY*/);
问题:打开节点,总是返回-1
一,检查dev/节点权限是否开放使用给予权限
chmod 777 /dev/test
代码中可在
init.rc中添加权限
/dev/test 0666 system system
二查看是否系统模式问题 getenforce
console:/ # getenforce
Permissive
如果不是Permissive模式而是Enforcing那么修改Enforcing为Permissive
console:/ # setenforce 0
代码中修改文件set_config中添加
setenv bootargs androidboot.selinux=permissive
三 如果系统是Enforcing模式而不想修改可以查看系统中的.te 文件添加对应的权限
版权声明
本文为[Johnny2004]所创,转载请带上原文链接,感谢
https://blog.csdn.net/Johnny2004/article/details/121944578
边栏推荐
- Recyclerview 批量更新View:notifyItemRangeInserted、notifyItemRangeRemoved、notifyItemRangeChanged
- BottomSheetDialogFragment + ViewPager+Fragment+RecyclerView 滑动问题
- oracle通过触发器和序列来定义自增主键,并且设置定时任务每秒钟插入一条数据到目标表
- 统一任务分发调度执行框架
- MarkDown基础语法笔记
- iTOP4412 HDMI显示(4.0.3_r1)
- mysql和pgsql时间相关操作
- Abnormal record-13
- 双指针仪表盘读数(一)
- Abnormal record-16
猜你喜欢
随机推荐
窗口分析函数LAST_VALUE,FIRST_VALUE,lag,lead
个人学习相关
Abnormal record-19
Dolphinscheduler配置Datax踩坑记录
Abnormal record-21
Prometheus alarm record persistence (historical alarm saving and Statistics)
Apprentissage par composantes
开篇:双指针仪表盘的识别
Comparison between Prometheus thanos and cortex components
MySQL5.7插入中文数据,报错:`Incorrect string value: ‘\xB8\xDF\xAE\xF9\x80 at row 1`
接口幂等性问题
oracle undo使用率高问题处理
Cause: dx.jar is missing
Apache Atlas 编译及安装记录
MySQL笔记4_主键自增长(auto_increment)
Information:2021/9/29 10:01 - Build completed with 1 error and 0 warnings in 11s 30ms Error异常处理
Exception record-5
通过rownum来进行区间查询
npm ERR code 500解决
RAC环境alert日志报错Drop transient type: SYSTP2JW0acnAurDgU1sBqMBryw==的排查









