[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: mmap for guile
From: |
Olivier Dion |
Subject: |
Re: mmap for guile |
Date: |
Sun, 26 Jun 2022 13:06:04 -0400 |
On Sun, 26 Jun 2022, Matt Wette <matt.wette@gmail.com> wrote:
> flags
> (logior MAP_ANON MAP_PRIVATE)
Why MAP_ANON instead of MAP_ANONYMOUS. The latter is more clear and you
don't have to care about compatibility like C does.
Also, does MAP_FIXED or MAP_FIXED_NOREPLACE is passed to `flags' if
`(not (eq? addr %null-pointer))'?
> scheme@(guile-user)> ,d mmap/search
What's the difference with `mmap'?
> scheme@(guile-user)> ,d mmap-file
> - Scheme Procedure: mmap-file file [prot]
> This procedure accepts a file in the form of filename, file-port or
> fd. It returns a bytevector. It must not contain scheme allocated
> objects as it will not be searched for pointers. Default PROT is
> `"r"'.
I assume that this map the entire file at offset 0 with PROT_READ? In
that case, is it with MAP_SHARED or MAP_PRIVATE? I think it's important
to mentioned this point.
Regards,
old
--
Olivier Dion
oldiob.dev