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