No, but you do worry about the timestamps being updated after
every write() call, no matter how large or small.
I don't believe that this is a valid characterization because the
changes to the contents of the file, made through the mmap'd region,
are immediately visible to any and all other applications accessing
the file. Since the contents of the file are changing, then so
should the timestamps to reflect this.
I think that we are going to have to agree to disagree because
I don't agree either with your characterizations of the desirable
semantics associated with shared mmap or that maintaining the
correctness in the system is a waste of CPU.
I view mmap as a way for an application to treat the contents of
a file as another segment in its address space. This allows it to
manipulate the contents of a file without incurring the overhead
of the read and write system calls and the double buffering that
naturally occurs with those system calls. I think that:
char *p = mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);
*p = 1;
*(p + 4096) = 2;
should have the same effect as:
char c = 1;
pwrite(fd, &c, 1, 0);
c = 2;
pwrite(fd, &c, 1, 4096);
Clearly, the two can't be equivalent since the operating system
can only become involved at certain times in order to update the
timestamps. That's why there are specifications about the
timestamps for things like msync. They should be as close as
possible though.
However, since I seem to be the only one presenting a different
viewpoint, then I will agree to disagree and commit. I will see
if I can sell your semantics to my customer and find out if that
will satisfy them.
Thanx...
ps
-