I am trying to access custom character say /dev/xyz device for file 
I/O(open and read) from Android user space(audio flinger to be specific).

When I try to open the device using 

FILE* = fopen(/dev/xyz, mode);  standard c library function

or

int open(const char *pathname, int flags); UNIX function

I get "permission denied - 13" error.

When I manually change the access permissions of /dev/xyz using 

chown system.media /dev/xyz

chmod 666 /dev/xyz

then try the fopen again it still fails but the error changes from 
permission denied to "No such device - 19"

Some more usefull info

when I write a simple binary to access the character device and run it from 
adb shell(which has root perms by default) I am able to open and read from 
the device.

I can also redirect the character device to cat successfully from adb shell 
by using "cat /dev/xyz > file.bin" and get desired oputput.


How can I successfully access this character device for file I/O from 
Android user space?

Thanks.


-- 
-- 
unsubscribe: [email protected]
website: http://groups.google.com/group/android-kernel
--- 
You received this message because you are subscribed to the Google Groups 
"Android Linux Kernel Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to