Matt Wette schreef op zo 26-06-2022 om 08:37 [-0700]:
> scheme@(guile-user)> ,d mmap/search
> - Scheme Procedure: mmap/search addr len [prot [flags [fd [offset]]]]
>       See the unix man page for mmap.  Returns a bytevector.  Note that
>       the region allocated will be searched by the garbage collector for
>       pointers.  Defaults:

The types aren't documented and I don't think just referring to the man
page is sufficient, because C and Scheme have actually different APIs
and semantics -- e.g., if I don't care about the address, can I set it
to #false?  Is it only fds or also ports?  Why does the abbreviation
'addr' mean (why not in full: address, likewise for 'len')?  C has its
own style of error reporting, but how does this map to Scheme? Do I get
a ENOENT return value, or a ENOENT system-error, an &i/o-file-is-read-
only, an &i/o-filename, an &i/o-invalid-position? Is the address a raw
number or a bytevector (made with pointer->bytevector) or a pointer? 
Is the offset inside the file, or w.r.t. the current position?

I think it's fine to not document all the MAP_ flags, but I think we
need at least the basics (MAP_ANONYMOUS, PROT_READ, PROT_WRITE).

Greetings,
Maxime.

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to