[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MirageOS-devel] Timestamp representation and CLOCK



> On 9 Jul 2015, at 14:47, Daniel BÃnzli <daniel.buenzli@xxxxxxxxxxxx> wrote:
> 
> 
> module type CLOCK = sig
> 
>  val now_s : unit -> int64 * int
>  (** [now_s ()] is [(s, ns)] the operating system's POSIX timestamp
>      for the current time understood as the number of seconds [s] +
>      1e-9 * [ns] from the epoch 1970-01-01 00:00:00 UTC. [ns] ranges
>      from [0] to [999_999_999]. *)
> 
>  val current_tz_offset_s : unit -> int
>  (** [current_tz_offset_s ()] is the operating system's current local
>      time zone offset to UTC in seconds. *)
> end
> 
> 
> Would people agree on such an API and change for the next major release of 
> mirage ? If so, I'd be willing to actually delve into the various repos to 
> make that happen. 

I think such an API would work (aside from the efficiency queries that
David Sheets raised).  The lack of `float` in the type is a huge win for
embedding this as a kernel module or other constrained environment.

I'm just wondering whether `current_tz_offset_s` needs to be potentially
blocking or not.  Dave, is the timezone read from Xenstore at all via the
Xen tools at the moment, or is it set independently per VM (with just the
wallclock time shared)?

-anil


_______________________________________________
MirageOS-devel mailing list
MirageOS-devel@xxxxxxxxxxxxxxxxxxxx
http://lists.xenproject.org/cgi-bin/mailman/listinfo/mirageos-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.