Ishadi Jayasinghe
Ishadi Jayasinghe

Reputation: 122

ashmem giving [Errno 13] Permission denied

In my rooted Android device,

jint fd = open("/dev/ashmem",O_RDWR);

gives -1 and fopen results in error 13. I've tried changing the permissions as well with chmod 777, but to no avail.

Any ideas? Thank you for your help.

Upvotes: 1

Views: 581

Answers (2)

Flot2011
Flot2011

Reputation: 4671

Apps targeting Android 10 cannot directly use ashmem (/dev/ashmem) and must instead access shared memory via the NDK’s ASharedMemory class

Upvotes: 1

Ishadi Jayasinghe
Ishadi Jayasinghe

Reputation: 122

Turns out it was due to the targetSdkVersion. It works when it's 28 but not at 30.

Upvotes: 0

Related Questions