Sujet : Re: Memory mapping: MAP_PRIVATE and msync()
De : lew.pitcher (at) *nospam* digitalfreehold.ca (Lew Pitcher)
Groupes : comp.lang.cDate : 07. Apr 2024, 17:49:38
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <uuufai$2rdn1$1@dont-email.me>
References : 1
User-Agent : Pan/0.139 (Sexual Chocolate; GIT bf56508 git://git.gnome.org/pan2)
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.
But, as I said, comp.unix.programmer will be of better help.
-- Lew Pitcher"In Skills We Trust"