Re: Memory mapping: MAP_PRIVATE and msync()

Liste des GroupesRevenir à cl c  
Sujet : Re: Memory mapping: MAP_PRIVATE and msync()
De : pehache.7 (at) *nospam* gmail.com (pehache)
Groupes : comp.lang.c comp.unix.programmer
Suivi-à : comp.unix.programmer
Date : 07. Apr 2024, 21:09:17
Autres entêtes
Organisation : Nemoweb
Message-ID : <3SRfxOJmmxW4o_baSf1Air4dZWk@jntp>
References : 1 2
User-Agent : Nemo/0.999a
Le 07/04/2024 à 15:49, Lew Pitcher a écrit :
On Sun, 07 Apr 2024 13:34:43 +0000, pehache wrote:
 
Hello,
 Hi, pehache
 
When memory mapping a file with the MAP_PRIVATE flag, the modifications (writes) only exist in memory and are not written back to the file.
[snip]
So: is there a way to write the changes back to the file?
[snip]
 The comp.unix.programmer newsgroup will be of better help for this sort
of question (it's not really on-topic for comp.lang.c).
 But, of the top of my head; with my limited understanding of the unix
mmap() kernel call, the only ways to "write the changes" are to either
1) mmap(MAP_SHARED) and modify the mapped area, or
2) write() the mapped area back to the file.
I'm currenly using the first option in my code. Either way, the whole mapped area is written back, even if there were only a few changes. I was hoping there could be another way to wrtite back only the modified pages.
But, as I said, comp.unix.programmer will be of better help.
fu2

Date Sujet#  Auteur
7 Apr 24 * Memory mapping: MAP_PRIVATE and msync()11pehache
7 Apr 24 +* Re: Memory mapping: MAP_PRIVATE and msync()6pehache
7 Apr 24 i+- Re: Memory mapping: MAP_PRIVATE and msync()1pehache
8 Apr 24 i`* Re: Memory mapping: MAP_PRIVATE and msync()4Lawrence D'Oliveiro
8 Apr 24 i +- Re: Memory mapping: MAP_PRIVATE and msync()1Kaz Kylheku
8 Apr 24 i `* Re: Memory mapping: MAP_PRIVATE and msync()2bart
9 Apr 24 i  `- Re: Memory mapping: MAP_PRIVATE and msync()1Lawrence D'Oliveiro
7 Apr 24 `* Re: Memory mapping: MAP_PRIVATE and msync()4Lew Pitcher
7 Apr 24  `* Re: Memory mapping: MAP_PRIVATE and msync()3pehache
8 Apr 24   `* Re: Memory mapping: MAP_PRIVATE and msync()2pehache
8 Apr 24    `- fu2 is fne (Was: Memory mapping: =?UTF-8?Q?MAP=5FPRIVATE=20and=20msync=28=29?=)1Kenny McCormack

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal