LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Kernel (http://www.linuxquestions.org/questions/linux-kernel-70/)
-   -   Device node access permissions in Linux (http://www.linuxquestions.org/questions/linux-kernel-70/device-node-access-permissions-in-linux-899890/)

ramonfried 08-28-2011 03:26 AM

Device node access permissions in Linux
 
I'm writing a char device driver for embedded android. The device module, register itself as a char device, and a corresponding device node is created under /dev . The problem is that the access permissions for this device is for root, and I can't read it from android applications (JNI). I have to manually "chmod +r" the device before running the application. How can I decide the access permission of a dynamically created device node ?

David the H. 08-28-2011 04:34 AM

To start with, you might get more detailed help at the LQ sister site:

http://www.androidquestions.org/

Now, while I'm not a kernel developer, most Linuxes these days use udev rules to populate the /dev directory.

http://www.reactivated.net/writing_udev_rules.html

This may not apply to embedded systems, however. According to this thread, which I found through a quick search, it looks like android relies on init.rc to do the dirty work. See the last comment.

http://www.linuxquestions.org/questi...ndroid-832703/

Search engines are quite useful things, don't you think?


All times are GMT -5. The time now is 03:34 PM.