Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5839399
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T11:34:45+00:00 2026-05-22T11:34:45+00:00

Im trying to use O_DIRECT to open a file and we’re using jffs2 fd

  • 0

Im trying to use O_DIRECT to open a file and we’re using jffs2

fd = open(filename, O_RDONLY|O_DIRECT|O_SYNC);

But i only get an "invalid argument" error.
I have also tried the solutions
in this SO link but to no avail.
Ofcourse i have also put in "-D_GNU_SOURCE" in building the source.

I’ve read that O_DIRECT is not supported on tmpfs, but couldn’t find support or un-support for jffs2.
If someone could give me proof or un-proof for jffs2 support and/or any other thing i’m missing to make O_DIRECT work.

note:
This all happened because Linux seem to cache memory data on its own when i use fread()/read().
And using system("echo 3 > /proc/sys/vm/drop_caches"); would be too late because I don’t want the FS allocating cache memory in the first place.

Thanks,
Naze

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T11:34:46+00:00Added an answer on May 22, 2026 at 11:34 am

    jffs2 does not support O_DIRECT.

    You can see in __dentry_open() that in order to support O_DIRECT, a filesystem must supply the direct_IO and/or get_xip_mem members of the address_space_operations struct. You can likewise see that jffs2 does not supply these members.

    It is not clear why you are so keen to avoid the page cache. Pages in the page cache are effectively “free” – they will be reclaimed when more memory is required for other uses.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying use mod_rewrite to rewrite URLs from the following: http://www.site.com/one-two-file.php to http://www.site.com/one/two/file.php The
Trying to use a guid as a resource id in a rest url but
Trying to use GnuPG with Delphi (Win32). I need to sign some file with
I'm trying to use glew in my Xcode project, but I'm getting this: Apple
I am trying to use wsdl2objc with this soap web service. But when am
I am trying to use the ini4j to get data from a windows software
I am trying to use the KeyChainitemwrapper provided by apple. My project is using
I am using trying to use scifihifi-iphone (from Github) to store and retrieve usernames
I am trying to use PdfSmartCopy from ItextSharp but I cannot find any relevant
I'm trying to use Heroku Taps but after gem install taps, I'm still getting

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.