Re: What's wrong on this mmap() ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On Fri, Sep 23, 2011 at 1:50 PM, Andrea Gasparini <gaspa@xxxxxxxxxxx> wrote:
> Hi,
> I'm having some problem understanding how mmap really works.
>
> I have a (dummy) driver that allocate some memory (4k), and gives it to a
> userspace through mmap() - the usual remap_pfn_pages found in every
> example.
>
> The userspace can read the memory correctly, but can't write to it. (though
> it maps with PROT_WRITE)
> As the manpage says: PROT_WRITE - Pages may be written.

Aerhm. If opened with  O_RDRW and mapped with MAP_SHARED it works as expected :)

Sorry for the silly question.
Bye!
--
- Andrea Gasparini -
-----------------------------------------------
-------- https://launchpad.net/~gaspa ---------
----- HomePage: http://gaspa.yattaweb.it ------

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux