readlink returns EACCES while trying to follow symbolic links present in the proc file system. This behaviour is observed only on Android applications built in release mode. The same isn't observed when the application is built in debug mode.
Additional Info:
- The call is made from native code.
- I have granted "android.permission.WRITE_EXTERNAL_STORAGE" to the application in AndroidManifest.xml.
- The application is built with minSdkVersion=14 and targetSdkVersion=26
- Behaviour is observed on all Android versions from Kitkat to Nougat.
Why does readlink exhibit this behaviour when the application is built in release mode? Are there any alternatives for readlink to trace symbolic links in /proc?
Thanks in advance.