From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Maxime Devos Newsgroups: gmane.lisp.guile.user,gmane.lisp.guile.devel Subject: Re: mmap for guile Date: Sun, 26 Jun 2022 20:21:05 +0200 Message-ID: References: <56ee7537-1666-3d04-7093-732a75624e9b@gmail.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-tl8RrhNr1av8smn5BJ6D" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7895"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Evolution 3.38.3-1 To: Matt Wette , guile-devel@gnu.org, Guile User Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Sun Jun 26 20:23:42 2022 Return-path: Envelope-to: guile-user@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o5Wv7-0001pj-UI for guile-user@m.gmane-mx.org; Sun, 26 Jun 2022 20:23:41 +0200 Original-Received: from localhost ([::1]:57540 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o5Wv6-0004j8-EB for guile-user@m.gmane-mx.org; Sun, 26 Jun 2022 14:23:40 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:44728) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o5Wsj-0000lY-9j for guile-user@gnu.org; Sun, 26 Jun 2022 14:21:19 -0400 Original-Received: from andre.telenet-ops.be ([2a02:1800:120:4::f00:15]:53336) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o5Wsg-0007YK-PS for guile-user@gnu.org; Sun, 26 Jun 2022 14:21:13 -0400 Original-Received: from ptr-bvsjgyhxw7psv60dyze.18120a2.ip6.access.telenet.be ([IPv6:2a02:1811:8c09:9d00:3c5f:2eff:feb0:ba5a]) by andre.telenet-ops.be with bizsmtp id nuM52700M4UW6Th01uM6M8; Sun, 26 Jun 2022 20:21:06 +0200 In-Reply-To: <56ee7537-1666-3d04-7093-732a75624e9b@gmail.com> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r22; t=1656267666; bh=IdeVHdDbYNI3f5s43qP7uIdCL4vGNYwdaxDtoHqvUGs=; h=Subject:From:To:Date:In-Reply-To:References; b=DyZMgPjby5+K/rosNQr9sqU44j1Q9CwKPe7LzLYQJWyZunn1iiQiSZU8N9XpN6GgV UPZkRhpJQVvcbtq4ZqmceH8hNn9OcoxDXxaWF06ig8q0JKSXWgqq1xTA2WfbeWQNIU hTS7xqvgExnxn3zdM05L+bzShK1rp2MFvKrWJHC0kdpZ6rY4HWqeKKJFwYMnzZdN2/ jRnxseZqlxe614kdvxWrg8QbER+K9kV9HP92u+FUOh6vXjkysymJpZDNiN0+w/GEb1 fFYmqNKmykfvfYHo5zvC2PAsfjvozHLNqjfdjJcAahXn1clJqoVdXeI8/e/yF3Hg2O w3oQ4dDcCxMvw== Received-SPF: pass client-ip=2a02:1800:120:4::f00:15; envelope-from=maximedevos@telenet.be; helo=andre.telenet-ops.be X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Original-Sender: "guile-user" Xref: news.gmane.io gmane.lisp.guile.user:18347 gmane.lisp.guile.devel:21245 Archived-At: --=-tl8RrhNr1av8smn5BJ6D Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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]]]] > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 See the unix man page for mmap.=C2=A0 Retu= rns a bytevector.=C2=A0 Note that > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 the region allocated will be searched by t= he garbage collector for > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 pointers.=C2=A0 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?=20 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. --=-tl8RrhNr1av8smn5BJ6D Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYrijkRccbWF4aW1lZGV2 b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7qTiAP0RaVWYH5uDWWfriHhijTyBHds9 moJ37hsOZug7OSmQmAEAt95In7aUjNYZt9d6zGC6TLTQuSRYnTlzF67cQDlQgwA= =Y0IW -----END PGP SIGNATURE----- --=-tl8RrhNr1av8smn5BJ6D--