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 213311
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T18:16:00+00:00 2026-05-11T18:16:00+00:00

I was playing around with memory-mapped files in C and was wondering if there

  • 0

I was playing around with memory-mapped files in C and was wondering if there
is a way to replace the FILE * from fopen with a memory mapped file transparently.

Example:

FILE * fp = g_fopen(...);

//Program does things to this fp.

fclose();

But instead, is it possible to have FILE *fp = my_fopen(…)

Where my own function would open a file on disk mmap it, maybe change contents and then pass back the FILE * without the program seeing anything
different except the new my_fopen() and my_fclose().

Is this possible to do without having to rewrite the way the operations are done in the program?

  • 1 1 Answer
  • 1 View
  • 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-11T18:16:00+00:00Added an answer on May 11, 2026 at 6:16 pm

    The magic words are “library interposition”. Here’s a good tutorial: http://developers.sun.com/solaris/articles/lib_interposers.html


    When Oracle purchased sun a lot of articles seem to have disappeared and/or aren’t accessible through Oracle’s website.

    Here’s some links that, for the time being, are functional:

    • This is the original article as published in 2001: Building Library Interposers for Fun and Profit (Dr. Dobbs)
    • The developers.sun.com link was a repost by the original author, possibly with changes from the 2001 article; this is the repost: Debugging and Performance Tuning with Library Interposers (Wayback Machine)
    • The Linker & Libraries Guide for Sun Studio / Oracle Solaris Studio. It covers the topic of library interposition with more technical details.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm playing around with the XCF active memory server. Is there a python library
playing around with a property file i figured that there seems to be a
I playing around with the sftp example from here: Stackoverflow: twisted conch filetransfer I
I am playing around with gcc -S to understand how memory and stack works.
I am playing around with Instruments. And I just recorded/profiled for memory leaks, I
Playing around with MongoDB and NoRM in .NET. Thing that confused me - there
I playing around with the Twitter API for my BlackBerry application. Is there any
Playing around with jQuery a bit (sorry, complete noob) I was wondering why this
I'm currently playing around with the memory allocation tracker of the DDMS tool. In
I've been playing around with c++ lately and wondered why there were so many

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.