Do you mean use fcntl() here to get the mode, or skip the saving of openmode altogether and use fcntl() in the close when flushing the page cache (as it was before) ?