I was porting/compiling androidvncserver for my android device, but when I run it (as root) I keep getting mmap errors.
The offending code looks like this:
/* Android does not use /dev/fb0. */
#define FB_DEVICE "/dev/graphics/fb0"
if ((fbfd = open(FB_DEVICE, O_RDONLY)) == -1)
{
printf("cannot open fb device %s\n", FB_DEVICE);
exit(EXIT_FAILURE);
}
<SNIP>
fbmmap = mmap(NULL, pixels * bytespp, PROT_READ, MAP_SHARED, fbfd, 0);
if (fbmmap == MAP_FAILED)
{
printf("mmap failed errno = %d\n", errno);
exit(EXIT_FAILURE);
}
I am looking for thoughts on how to debug this further.
For the record, pixels=614400 and bytespp=4. Also, /dev/graphics/fb0 is owned by root (group=graphics), and has permissions of 660.