From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id UAA31386; Fri, 18 Apr 2003 20:04:56 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id UAA31399 for ; Fri, 18 Apr 2003 20:04:54 +0200 (MET DST) X-SPAM-Warning: Sending machine is listed in blackholes.five-ten-sg.com Received: from smtp1.cp.tin.it (vsmtp1.tin.it [212.216.176.221]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id h3II4r906072 for ; Fri, 18 Apr 2003 20:04:53 +0200 (MET DST) Received: from dalamar.takhisis.org (80.180.77.218) by smtp1.cp.tin.it (6.7.016) id 3E8D72DB005DAD13 for caml-list@inria.fr; Fri, 18 Apr 2003 20:04:51 +0200 Received: from lordsoth.takhisis.org (lordsoth.takhisis.org [192.168.1.119]) by dalamar.takhisis.org (Postfix) with ESMTP id 90D00B7A9 for ; Fri, 18 Apr 2003 20:04:33 +0200 (CEST) Received: by lordsoth.takhisis.org (Postfix, from userid 3148) id 56ADB7070; Fri, 18 Apr 2003 20:04:33 +0200 (CEST) Date: Fri, 18 Apr 2003 20:04:33 +0200 From: Stefano Zacchiroli To: Inria Ocaml Mailing List Subject: Re: [Caml-list] OCaml signal handlers (Sys.signal) and C code Message-ID: <20030418180433.GA10194@lordsoth.takhisis.org> Mail-Followup-To: Inria Ocaml Mailing List References: <20030404165616.GA17379@lordsoth.takhisis.org> <20030416211607.B30839@pauillac.inria.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030416211607.B30839@pauillac.inria.fr> User-Agent: Mutt/1.5.4i X-Spam: no; 0.00; bononia:01 caml-list:01 damien:01 byterun:01 otherlibs:01 val:01 compiler:01 ocaml:01 blocking:01 int:01 behaviour:01 0200,:01 unix:02 bologna:03 heap:03 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Wed, Apr 16, 2003 at 09:16:07PM +0200, Xavier Leroy wrote: > enter_blocking_section(); > /* call C functions */ > leave_blocking_section(); Ok, thanks Xavier and Damien for the answers. Let's go to the next level: 1) {enter,leave}_blocking_section are defined in byterun/signal.{h,c} and shipped inside libcamlruntime.a. The problem is that signal.h isn't shipped in the standard ocaml includes, I can obviously trick the C compiler, but is this the intended behaviour? 2) looking at otherlibs/unix/connect.c I see this block of code: enter_blocking_section(); retcode = connect(Int_val(socket), &addr.s_gen, addr_len); leave_blocking_section(); Int_val is used inside the blocking section. I guess that this is safe because integers aren't heap allocated. Tell me if I'm wrong. Cheers. -- Stefano Zacchiroli -- Master in Computer Science @ Uni. Bologna, Italy zack@{cs.unibo.it,debian.org,bononia.it} - http://www.bononia.it/zack/ " I know you believe you understood what you think I said, but I am not sure you realize that what you heard is not what I meant! " -- G.Romney ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners