From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Mark H Weaver 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 03:08:23 -0500 Message-ID: <87twzgeh3c.fsf@yeeloong.lan> References: <87fvf8oocf.fsf@ft.bewatermyfriend.org> <87h9vmy0zw.fsf@gnu.org> 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 1422087132 30379 80.91.229.3 (24 Jan 2015 08:12:12 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 24 Jan 2015 08:12:12 +0000 (UTC) Cc: Chaos Eternal , 18592@debbugs.gnu.org To: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Sat Jan 24 09:12:11 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 1YEvpC-0005Xs-Tc for guile-bugs@m.gmane.org; Sat, 24 Jan 2015 09:12:11 +0100 Original-Received: from localhost ([::1]:34261 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YEvpB-0004M9-LM for guile-bugs@m.gmane.org; Sat, 24 Jan 2015 03:12:09 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34080) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YEvp8-0004M2-0x for bug-guile@gnu.org; Sat, 24 Jan 2015 03:12:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YEvp4-0005bG-RV for bug-guile@gnu.org; Sat, 24 Jan 2015 03:12:05 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:36076) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YEvp4-0005b9-Nw for bug-guile@gnu.org; Sat, 24 Jan 2015 03:12:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1YEvp4-00073w-8d for bug-guile@gnu.org; Sat, 24 Jan 2015 03:12:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Mark H Weaver Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Sat, 24 Jan 2015 08:12:02 +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.142208707427082 (code B ref 18592); Sat, 24 Jan 2015 08:12:02 +0000 Original-Received: (at 18592) by debbugs.gnu.org; 24 Jan 2015 08:11:14 +0000 Original-Received: from localhost ([127.0.0.1]:54768 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YEvoH-00072j-Qx for submit@debbugs.gnu.org; Sat, 24 Jan 2015 03:11:14 -0500 Original-Received: from world.peace.net ([50.252.239.5]:50222 ident=hope1) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YEvoE-00072X-9W for 18592@debbugs.gnu.org; Sat, 24 Jan 2015 03:11:11 -0500 Original-Received: from [10.1.10.10] (helo=yeeloong.lan) by world.peace.net with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1YEvo7-0002G3-9z; Sat, 24 Jan 2015 03:11:03 -0500 In-Reply-To: <87h9vmy0zw.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Mon, 19 Jan 2015 21:22:11 +0100") 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:7715 Archived-At: 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 extens= ible (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 Of the proposals given here, I would support #1, but maybe there's a better option. Thanks, Mark