From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) Newsgroups: gmane.lisp.guile.bugs Subject: bug#18592: FFI should have portable access to =?UTF-8?Q?=E2=80=98errno=E2=80=99?= Date: Sat, 24 Jan 2015 11:33:42 +0100 Message-ID: <87r3uko4c9.fsf@gnu.org> References: <87fvf8oocf.fsf@ft.bewatermyfriend.org> <87h9vmy0zw.fsf@gnu.org> <87twzgeh3c.fsf@yeeloong.lan> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1422095650 21824 80.91.229.3 (24 Jan 2015 10:34:10 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 24 Jan 2015 10:34:10 +0000 (UTC) Cc: Chaos Eternal , 18592@debbugs.gnu.org To: Mark H Weaver Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Sat Jan 24 11:34:09 2015 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YEy2a-0004AS-B4 for guile-bugs@m.gmane.org; Sat, 24 Jan 2015 11:34:08 +0100 Original-Received: from localhost ([::1]:34592 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YEy2Z-0003GZ-LH for guile-bugs@m.gmane.org; Sat, 24 Jan 2015 05:34:07 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37008) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YEy2V-0003BE-6G for bug-guile@gnu.org; Sat, 24 Jan 2015 05:34:04 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YEy2U-0006N4-8w for bug-guile@gnu.org; Sat, 24 Jan 2015 05:34:03 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:36133) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YEy2U-0006Mu-5K for bug-guile@gnu.org; Sat, 24 Jan 2015 05:34:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1YEy2T-000253-QC for bug-guile@gnu.org; Sat, 24 Jan 2015 05:34:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Sat, 24 Jan 2015 10:34:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 18592 X-GNU-PR-Package: guile X-GNU-PR-Keywords: Original-Received: via spool by 18592-submit@debbugs.gnu.org id=B18592.14220956277973 (code B ref 18592); Sat, 24 Jan 2015 10:34:01 +0000 Original-Received: (at 18592) by debbugs.gnu.org; 24 Jan 2015 10:33:47 +0000 Original-Received: from localhost ([127.0.0.1]:54825 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YEy2F-00024W-4m for submit@debbugs.gnu.org; Sat, 24 Jan 2015 05:33:47 -0500 Original-Received: from fencepost.gnu.org ([208.118.235.10]:33282 ident=Debian-exim) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YEy2D-00024P-Ev for 18592@debbugs.gnu.org; Sat, 24 Jan 2015 05:33:45 -0500 Original-Received: from reverse-83.fdn.fr ([80.67.176.83]:49749 helo=pluto) by fencepost.gnu.org with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1YEy2C-0005kJ-L4; Sat, 24 Jan 2015 05:33:45 -0500 X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 5 =?UTF-8?Q?Pluvi=C3=B4se?= an 223 de la =?UTF-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0xEA52ECF4 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 83C4 F8E5 10A3 3B4C 5BEA D15D 77DD 95E2 EA52 ECF4 X-OS: x86_64-unknown-linux-gnu In-Reply-To: <87twzgeh3c.fsf@yeeloong.lan> (Mark H. Weaver's message of "Sat, 24 Jan 2015 03:08:23 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-guile@gnu.org List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Original-Sender: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.bugs:7717 Archived-At: Mark H Weaver skribis: > ludo@gnu.org (Ludovic Court=C3=A8s) writes: > >> Chaos Eternal skribis: >> >>> Proposals to solve this bug: >>> >>> Proposal 1. >>> >>> Adding a keyword argument to pointer->procedure, if set to true, the >>> generated wrapper will check 'errno' immediately after ffi_call and >>> return the errno as second value. >>> >>> the proposed pointer->procedure maybe like this: >>> pointer->procedure return_type func_ptr arg_types #:return-errno >>> >>> Proposal 2. >>> >>> let pointer->procedure check return_type, if it is a list: >>> (func_return_type, 'errno) >>> then return multiple values, as errno be second value. >> >> That=E2=80=99s my favorite because it=E2=80=99s both pragmatic and exten= sible (we can >> also add support for h_errno, etc.) > > We can't do this, because although it's not documented in our manual, a > list passed as a foreign type already has a meaning: it means a struct. > See 'parse_ffi_type' in foreign.c. I mentioned this fact on guile-user: > > https://lists.gnu.org/archive/html/guile-user/2012-05/msg00037.html Indeed, I had forgotten that. > Of the proposals given here, I would support #1, but maybe there's a > better option. I agree #1 is now the best option so far. Ludo=E2=80=99.