Do NDK support O_DIRECT flag when open file?

157 views
Skip to first unread message

Ryan Wang

unread,
Nov 25, 2010, 7:34:18 AM11/25/10
to android-ndk
I am working with a project that need to read file in the SD card
immediately. So I want to use open API with the flag O_DIRECT. Open is
working fine. But when I read the file, it goes error. And the error
code is 22, which means "Invalid argument". I don't know why. Do the
NDK or Android platform support this flag? If support, how to use it.
Thanks.

David Turner

unread,
Nov 26, 2010, 11:16:43 AM11/26/10
to andro...@googlegroups.com
Are you sure that your buffers are properly aligned? O_DIRECT has drastic requirements for proper usage.
See the related section at the end of the following page: http://manpages.courier-mta.org/htmlman2/open.2.html

Apart from that, I don't think there is a reason for O_DIRECT to not be supported.


--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To post to this group, send email to andro...@googlegroups.com.
To unsubscribe from this group, send email to android-ndk...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.


Reply all
Reply to author
Forward
0 new messages