lkml.org 
[lkml]   [2011]   [Mar]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    Subjectremap_file_pages doesn't like MAP_ANONYMOUS (but used to?)
    Hello,
      In older kernels (2.6.15-2.6.18?) I was able to make an anonymous mapping and remap part of it back over itself to create a circular buffer:
      p = mmap(0, sz, PROT_READ | PROT_WRITE, MAP_SHARED | MAP_ANONYMOUS, -1, 0)
      remap_file_pages(p + sz/2, sz/2, 0/*prot*/, 0/*offset*/, 0/*flags*/)

    I find the same method fails with EINVAL on the remap_file_pages call in 2.6.35/38. Making a dummy file or shared memory object works, but seems a bit more messy.

    Why drop support for ANONYMOUS? Is there another way to get the same effect?

    thanks,
    -Kenny




    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2011-03-17 07:05    [W:0.123 / U:87.728 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site