From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Jeff Mickey Newsgroups: gmane.lisp.guile.user Subject: Re: dynamic-link on libc Date: Fri, 04 Aug 2017 15:12:15 -0700 Message-ID: <1501884735.1714809.1063641400.66289926@webmail.messagingengine.com> References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1501884766 18007 195.159.176.226 (4 Aug 2017 22:12:46 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 4 Aug 2017 22:12:46 +0000 (UTC) Cc: guile-user@gnu.org To: Matt Wette Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Sat Aug 05 00:12:42 2017 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ddkpi-0004I8-6D for guile-user@m.gmane.org; Sat, 05 Aug 2017 00:12:38 +0200 Original-Received: from localhost ([::1]:54547 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ddkpo-0003kz-7F for guile-user@m.gmane.org; Fri, 04 Aug 2017 18:12:44 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52448) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ddkpP-0003fv-Ab for guile-user@gnu.org; Fri, 04 Aug 2017 18:12:20 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ddkpM-0002XE-6Q for guile-user@gnu.org; Fri, 04 Aug 2017 18:12:19 -0400 Original-Received: from out1-smtp.messagingengine.com ([66.111.4.25]:41585) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ddkpM-0002Vt-05 for guile-user@gnu.org; Fri, 04 Aug 2017 18:12:16 -0400 Original-Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 67D0120DB6; Fri, 4 Aug 2017 18:12:15 -0400 (EDT) Original-Received: from web1 ([10.202.2.211]) by compute3.internal (MEProxy); Fri, 04 Aug 2017 18:12:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=codemac.net; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=mesmtp; bh=whYpoKJNob46G6dPbxJPW+WCwh sWfcy59zeOk6r6qOo=; b=QqF2k81ppqUg0EaAH0IfzUnvzg2vrohGR1y2UJ63t/ 70bjk1aRWJib7pw+ZP8UNJRD9t0m0aEC2iJdnYu5Q2Lw5QHICmX5XYRt8IRcUxvX 54OgFOtelTiIdh6cmlTZueFUHEZEc0vj/dburX6kbtytTPL+10Pn+PAWBu/ZV2XM 0= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=whYpoK JNob46G6dPbxJPW+WCwhsWfcy59zeOk6r6qOo=; b=N1kFAVI9GPL+7yX/VP2sv8 Llsx1ay+HQXYeRf6nmM0DCMwg+rHAqU1/u7hV8REDjixEHNTYk/tT7lolYrd0Xx+ uveD0a5x7p+OjBmBcX+35t8WQRAGHhAOz7WqQzeIuFYrhcK0BnRCAPMTZOsluPof wZOF4mbDM70S+uIzwn+P8JeE5MuCzW14WVD08i+eKXnBvuJavOXfzwLGN3cji97R r21c8e5oBjsQ3lfcR9+MsHquFWd5Ypuwws7ZlipjuSFWM8qYNM5fnzf4mR45rEiB 9z2NGiiphBfPRbtiu9vohWka2Tk0Ny/l8CTZ6G7Zi3C4d/sntFP7GmXCtAIVVHtg == X-ME-Sender: Original-Received: by mailuser.nyi.internal (Postfix, from userid 99) id 4C4EA956F5; Fri, 4 Aug 2017 18:12:15 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface - ajax-7b2cde4a In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.111.4.25 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.21 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.org@gnu.org Original-Sender: "guile-user" Xref: news.gmane.org gmane.lisp.guile.user:14022 Archived-At: That solves my problem! Thank you so much :) libc is a special case, and I should have thought about it more. // mickey On Fri, Aug 4, 2017, at 14:44, Matt Wette wrote: >=20 > > On Aug 4, 2017, at 2:15 PM, Jeff Mickey wrote: > >=20 > > Hi guilers! > >=20 > > I cannot seem to call `dynamic-link' on libc. > >=20 > > I'm trying to write a simple, dumb wrapper around syslog using the (sys= tem foreign) dynamic library to learn how to use the dynamic ffi. > >=20 > > (use-modules (system foreign)) > > (define libcsyslog (dynamic-link "libc")) (define syslog (let ((f (po= inter->procedure void (dynamic-func "syslog" libcsyslog) (list int = '*)))) (lambda (level msg) (let* ((clevel level) (cmsg (str= ing->pointer msg))) (f clevel cmsg))))) (syslog 3 "hello there")=20 > >=20 > > This works when I symlink /lib/x86_64-linux-gnu/libc.so.6 to libc.so, b= ut it looks like the libtool library that is doing the load doesn't accept = names that end in ".6" as a library name, and when I used the full path it = just says "file not found". > >=20 > > Anyone have suggestions? I looked at the dynl.c sysdep_dynl_link functi= on, but I'm not sure I understand libtool well enough to know what lt_dlope= next should be doing. > >=20 > > I should add I tested this on a debian system with a debian provided gu= ile, and a "user installed guix" guile install as well. > >=20 > > Thanks! > >=20 > > // codemac > >=20 >=20 > I don=E2=80=99t think you need to dynamic-link libc; just use (dynamic-fu= nc > "syslog" (dynamic-link)). >=20