mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* About mmap
@ 2002-10-31 14:05 Sebastien Morand
  0 siblings, 0 replies; only message in thread
From: Sebastien Morand @ 2002-10-31 14:05 UTC (permalink / raw)
  To: linux-kernel

I'm implementing a cache for a database file system. Using mmap I
would like to know how mmap works.

For instance if my file is open in read/write and I'm mapping in
read/write but I use only the block in write, is the kernel going to
read on the disk?

Here is a sample code:
int h = open(file, O_RDWR | O_SYNC);
void * memory =
  mmap(0, pageSize, PROT_WRITE | PROT_READ, MAP_SHARED, handle, 0);

I'm actually using the same code to get read or write block, so if I'm
using the block in write only I would like to know if this code is
correct or if I'd better change the flags according to writing or
reading access.

Sincerely,
Sebastien Morand.

NB: I'm not on the mailing list, can you put my e-mail in CC to reply
please.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2002-10-31 13:41 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-10-31 14:05 About mmap Sebastien Morand

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®