This week, I had some issues on my tests in a Lollipop device with AOSP. I really wanted to have synchronous reads/writes so that I could evaluate my solution in a different way. I am also trying to minimize the effects of caching as much as possible. If you check for async and sync I/O operations for Linux, you'll a lot of references to the flags O_DIRECT, O_SYNC, O_DSYNC, ...
Actually, that's a good way to implement. However, with Android NDK apps, things are not so straightforward.
First, to have a good understanding about the O_*SYNC flags, check this link. Of course, the man page for the command open as well.
First, O_DIRECT does not work in Android since 4.4. See this link for more details about it. That's sad. So, let's try to use the O_*SYNC data.
O_SYNC and O_DSYNC work fine in Android. But, as the description say, only for writes. Another detail: for Android, O_SYNC has the same semantics as O_DSYNC. That's good, but I still want something similar to reads as well.
Why don't we use O_RSYNC? Well, Android does not implement it :-( But it's not the only one... there are other Linux distributions that don't do it either.
What about dropping caches?? See this link for more details. Hum, that works, but after the first read, the data will be cached again :-(
So, I am still looking for a solution for Android Lollipop. Hope to post it soon!
Dear Maemo community, I have the great honor of introducing the new Community Council for the upcoming Q2/2015 period.
The members of the new council are (in alphabetical order):
- Bernardo Reino (reinob)
- Halit Bal (HtheB)
- Gido Griese (win7mac)
- Jussi Ohenoja (juiceme)
- Peter Leinchen (peterleinchen)
The voting results can be seen on the voting page
I want to thank warmly all the members of the community who participated in this most important action of choosing a new council for us!
The new council shall meet on the #maemo-meeting IRC channel next tuesday at 20:00 UTC for the formal handover with the passing council.
Jussi Ohenoja, On behalf of the outgoing Maemo Community Council