From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andy Wingo Newsgroups: gmane.lisp.guile.devel Subject: a little puzzle Date: Fri, 08 Oct 2010 19:14:34 +0200 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1286557878 26686 80.91.229.12 (8 Oct 2010 17:11:18 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 8 Oct 2010 17:11:18 +0000 (UTC) To: guile-devel Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Fri Oct 08 19:11:17 2010 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1P4GTR-0001Vc-Bk for guile-devel@m.gmane.org; Fri, 08 Oct 2010 19:11:13 +0200 Original-Received: from localhost ([127.0.0.1]:39264 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P4GTQ-0001Qe-R0 for guile-devel@m.gmane.org; Fri, 08 Oct 2010 13:11:12 -0400 Original-Received: from [140.186.70.92] (port=59513 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P4GTN-0001Q4-6P for guile-devel@gnu.org; Fri, 08 Oct 2010 13:11:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1P4GTL-00006b-Tx for guile-devel@gnu.org; Fri, 08 Oct 2010 13:11:09 -0400 Original-Received: from a-pb-sasl-quonix.pobox.com ([208.72.237.25]:43145 helo=sasl.smtp.pobox.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1P4GTL-00006B-RM for guile-devel@gnu.org; Fri, 08 Oct 2010 13:11:07 -0400 Original-Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTP id 3FB7CDC4B4 for ; Fri, 8 Oct 2010 13:11:07 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to :subject:date:message-id:mime-version:content-type; s=sasl; bh=V wmmVI57BX/jcz5aveIiEZA8OSM=; b=ybrjjYg4BPbknUoTQcgnKYaw4VR77/Ouc 00fLhpuiKcMHrbylGK1HMX9wlTugGg0ya0bcM/GjW+s6nGCT7C+b0PCWTku5ndFi 1AqQZ2Mr2pLbIj1DNDGTKmR4VcV2mdWarbFe4ppxDALfUmz65fu5hBIxKTe3rVzf Iv7VbStmoI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:subject :date:message-id:mime-version:content-type; q=dns; s=sasl; b=VoI 1JCo0ELWDu2h2oC9+BwNyKCEhbO6jaJMgU1duZ3Zqg/jH/uAU2DxmmFl40nXvSvM r3rNNSpjMeYD/oShUW7YQVlb9QXBB65vb0ltruPjRQZ8fPzTq1X504tzHqn5Kf1B BJU5pPWcVBzC0sfaE18kTkzMpIIPSssr0DW9lyxg= Original-Received: from a-pb-sasl-quonix. (unknown [127.0.0.1]) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTP id 3804CDC4B3 for ; Fri, 8 Oct 2010 13:11:07 -0400 (EDT) Original-Received: from unquote.localdomain (unknown [81.38.188.65]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTPSA id A5E01DC4B2 for ; Fri, 8 Oct 2010 13:11:06 -0400 (EDT) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) X-Pobox-Relay-ID: 0A12A710-D2FF-11DF-93EB-030CEE7EF46B-02397024!a-pb-sasl-quonix.pobox.com X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:11008 Archived-At: Put this in your REPL and smoke it: (define* (make-me-a-socket #:key (host #f) (addr (if host (inet-aton host) INADDR_LOOPBACK)) (port 37146)) (let ((server (socket PF_INET SOCK_STREAM 0))) (setsockopt server SOL_SOCKET SO_REUSEADDR 1) (bind server AF_INET addr port) (listen server 5) server)) (sigaction SIGINT (lambda (sig) (throw 'foo))) (define s (make-me-a-socket)) (accept s) ; Now Ctrl-C What do you expect to happen here? Probably not this: ERROR: In procedure accept: ERROR: Interrupted system call Entering a new prompt. Type `,bt' for a backtrace or `,q' to continue. scheme@(guile-user) [1]> Throw to key `foo' with args `()' while reading expression. scheme@(guile-user) [1]> That's right: two throws for the price of one! The interrupted syscall, and then the asynchronous signal. Fun... Andy -- http://wingolog.org/