lkml.org 
[lkml]   [1997]   [Jan]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    SubjectRe: mmap(MAP_SHARED | MAP_ANON) broke!
    From
    Date
    >>>>> "Sujal" == Sujal Patel <smpatel@prognet.com> 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);
    munmap(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.

    Eric




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