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: dynamic-link on libc Date: Fri, 04 Aug 2017 14:15:46 -0700 Message-ID: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; format=flowed X-Trace: blaine.gmane.org 1501882210 7788 195.159.176.226 (4 Aug 2017 21:30:10 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 4 Aug 2017 21:30:10 +0000 (UTC) To: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Fri Aug 04 23:30:03 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 1ddkAU-0001Yb-S7 for guile-user@m.gmane.org; Fri, 04 Aug 2017 23:30:03 +0200 Original-Received: from localhost ([::1]:54456 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ddkAZ-0004Hv-9A for guile-user@m.gmane.org; Fri, 04 Aug 2017 17:30:07 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50936) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ddjxA-0008Ty-4h for guile-user@gnu.org; Fri, 04 Aug 2017 17:16:16 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ddjx5-0004aM-6W for guile-user@gnu.org; Fri, 04 Aug 2017 17:16:16 -0400 Original-Received: from out1-smtp.messagingengine.com ([66.111.4.25]:40481) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ddjx4-0004Ym-Vg for guile-user@gnu.org; Fri, 04 Aug 2017 17:16:11 -0400 Original-Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 103E720C82; Fri, 4 Aug 2017 17:16:09 -0400 (EDT) Original-Received: from frontend1 ([10.202.2.160]) by compute3.internal (MEProxy); Fri, 04 Aug 2017 17:16:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=codemac.net; h= content-type:date:from:message-id:mime-version:subject:to :x-me-sender:x-me-sender:x-sasl-enc:x-sasl-enc; s=mesmtp; bh=UQC rmQx4WsEpSgGvTsKk1o8mTaZF6EppgsdahW9xnPg=; b=hg5izUgPZpYyKhBKi1P b7OBjkhRkWqJ77WiDdar7AaSj3qrJqE3Qru6tKsoNWH5QVe/56Vg61Ex2rCAKNqx BUbdeIWmcsMz1/FjV/LQ3jViiJ5Zm+VwDqxu5JZIflibo6iO4TB3Wrj6MEV94Bi4 qrPBq7C1Kow5BntJWCKs84aA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:message-id :mime-version:subject:to:x-me-sender:x-me-sender:x-sasl-enc :x-sasl-enc; s=fm1; bh=UQCrmQx4WsEpSgGvTsKk1o8mTaZF6EppgsdahW9xn Pg=; b=ZhpL6l7YFuNmCeZE359Tw4IV0FxWTX0oSizHneqbn9qcdb+Al9/fW6s2W aT8Ca0/DUtaZ32nzuOW/H5vrEcLt0eJQ21nZEi9RJrtG9an/hnAvovuDrxQhfFaH MksPzeN8oNprPUL2aM+Se9Q6be3/OgpvNrjlWJDwmZDS1+g5NntKbfD/qJmQI9pz Z2zSPn6J9LZBphq/YRicpbbxVihu400/BgFge9ARo0SUfI7D/XhtyGpuuhALoAIh O/a2+plLzEz0Tkxantbz3KdltHe1BPckHFMQ5Gei9w4KHbIRFAY3skF1bw47LFeE UWwapUY0cJSGk3a2PKZl6ovwiA3Rg== X-ME-Sender: X-Sasl-enc: o8S6ig4ymMifcRWDPtnW0JquI+PM3DCdzjlM3dgRpYnS 1501881368 Original-Received: from jmickey-glaptop0.codemac.net (unknown [104.133.9.91]) by mail.messagingengine.com (Postfix) with ESMTPA id 9BC827E8D6 for ; Fri, 4 Aug 2017 17:16:08 -0400 (EDT) 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-Mailman-Approved-At: Fri, 04 Aug 2017 17:29:42 -0400 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:14020 Archived-At: Hi guilers! I cannot seem to call `dynamic-link' on libc. I'm trying to write a simple, dumb wrapper around syslog using the (system foreign) dynamic library to learn how to use the dynamic ffi. (use-modules (system foreign)) (define libcsyslog (dynamic-link "libc")) (define syslog (let ((f (pointer->procedure void (dynamic-func "syslog" libcsyslog) (list int '*)))) (lambda (level msg) (let* ((clevel level) (cmsg (string->pointer msg))) (f clevel cmsg))))) (syslog 3 "hello there") This works when I symlink /lib/x86_64-linux-gnu/libc.so.6 to libc.so, but 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". Anyone have suggestions? I looked at the dynl.c sysdep_dynl_link function, but I'm not sure I understand libtool well enough to know what lt_dlopenext should be doing. I should add I tested this on a debian system with a debian provided guile, and a "user installed guix" guile install as well. Thanks! // codemac