Re: Simple question about mmap() system call
- From: Dmitry Pryanishnikov <dmitry@xxxxxxxxxxxxxx>
- Date: Fri, 23 Jun 2006 20:05:01 +0300 (EEST)
Hello!
On Fri, 23 Jun 2006, Konstantin Belousov wrote:
if ((diskp=mmap(NULL, 512,You forgot MAP_SHARED.
PROT_READ | PROT_WRITE, 0, fd, 0)) == MAP_FAILED)
err(EX_IOERR, "Can't mmap() file");
shows actual first byte of my file. But modification doesn't get written
back to the disk, file contents are unchanged after execution of my code.
I'm sure I'm overlooking something very basic and stupid, but can't find
what exactly.
Thank you! Yes, that's it. I would say that it's description
MAP_SHARED Modifications are shared.
is rather terse and doesn't explicitly says that w/o it data will not be
stored back to the mmapped object. One can only deduce this behaviour,
and deduction sometimes fails at the end of working day ;)
Sincerely, Dmitry
--
Atlantis ISP, System Administrator
e-mail: dmitry@xxxxxxxxxxxxxx
nic-hdl: LYNX-RIPE
_______________________________________________
freebsd-hackers@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@xxxxxxxxxxx"
- References:
- Simple question about mmap() system call
- From: Dmitry Pryanishnikov
- Simple question about mmap() system call
- Prev by Date: Re: Simple question about mmap() system call
- Next by Date: Re: Virtual device driver programming
- Previous by thread: Re: Simple question about mmap() system call
- Next by thread: Buses, devices and modules
- Index(es):