I am trying to read the resource file for my device and mmap
it to read the device registers but when i try open the file location error prompts : NO such file or directory. I have changed the permissions of the file using chmod 666. The code I am using to open the file :
sprintf(filePath , "sys/bus/pci/devices/%04x:%02x:%02x.%d/resource0",segment,bus,device,function)
fileHandle = open(filePath , O_RDONLY);
if (fileHandle < 0)
{
perror("ERRRO : ");
}
The file exists and I am able to read it using the cat utility.