[lkml]   [1997]   [Jan]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    SubjectRe: mmap(MAP_SHARED | MAP_ANON) broke!
    >>>>> "Sujal" == Sujal Patel <> writes:

    Sujal> On Fri, 10 Jan 1997, Mark Hemment wrote:
    >> I guess you need this so that the anon mapped pages are not marked
    >> COW upon fork().

    Sujal> Correct.

    >> There might be another problem, or two, but if you have enough
    >> memory just try changing do_mmap() and see what happens.

    There is also another solution (That's a real hack).
    x = mmap(..., MAP_ANON |MAP_PRIVATE, ...);
    fd = open("/proc/self/mem");
    y = mmap(...., MAP_SHARED, ..., fd, x);

    There are some problems with this multiple mappings at different
    adresses may have some problems, and it isn't a supported linux feature.
    But for the moment it seems to work alright.

    This might also be useful. I wish someone could trace through the
    kernel and get whatever about the above sequence that works into the
    regular mmap command. Oh, well.


     \ /
      Last update: 2005-03-22 13:38    [W:0.017 / U:6.320 seconds]
    ©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site