I am building a custom Android os by inserting some my own code into Android OS code file "/art/runtime/art_method.cc". In my code, I want to read a text file by calling the following read file function:
FILE* f = fopen(file_name,"r");
However, I find that the inserted code cannot read the text file when the Android OS is running.
The version of Android OS source code is android-8.1.0_r40
I read a post in stack overflow: Read/write files within a Linux kernel module but it is related to the Linux kernel but not the android kernel. There are no C head files in the accepted answer for Android OS source code.
So, I want to know how to read the file in the Android kernel.
Thank you very much!