From: Ian Jackson Subject: Re: [PATCH 2/3] libxl: ocaml: use int64 for timeval fields in the timeout_register callback Date: Thu, 12 Dec 2013 16:51:58 +0000 Message-ID: <21161.59822.56479.935901@mariner.uk.xensource.com> References: <1386866211-12639-1-git-send-email-rob.hoes@citrix.com> <1386866211-12639-3-git-send-email-rob.hoes@citrix.com> <21161.59304.396688.333495@mariner.uk.xensource.com> <360717C0B01E6345BCBE64B758E22C2D1AC329@AMSPEX01CL03.citrite.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <360717C0B01E6345BCBE64B758E22C2D1AC329@AMSPEX01CL03.citrite.net> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Rob Hoes Cc: Dave Scott , Ian Campbell , "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org Rob Hoes writes ("RE: [PATCH 2/3] libxl: ocaml: use int64 for timeval fields in the timeout_register callback"): > Ian Jackson wrote: > > If it would help I would be happy to have libxl promise never to use such > > absurdly long timeouts. > > This was because the absolute time is given to timeout_register, and the tv_sec field of the timeval that comes out of gettimeofday() is just a little too large for a 31-bit signed integer... Oh, right. > I didn't see this before, because I was testing on a 64-bit box. When I moved to our 32-bit dom0, it started overflowing. I had forgotten that the timeout registration presents an absolute timeval. Does ocaml not have a more natural format for a timeval than two int64's ? (The tv_nsec field is guaranteed to be < 1E9 so fits in 30 bits...) Ian.