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

Re: [MirageOS-devel] Unix.tm, CLOCK: date handling in MirageOS



A lightweight time library would be useful.  The issue with the current
CLOCK interface is that it defines a record type within a module type,
which is a little pointless -- it should be defined somewhere else such
as a library.

Two of Daniel's library's may help here:
- Mtime defines monotonic time (and maps it to POSIX/Js and could easily
  also be mapped to Xen PV)
- Bos defines OS interactions, such as seconds-since-1970:
  http://erratique.ch/software/bos/doc/Bos.OS.Time.html

The missing one here is something that breaks down the time into
something consumable by a calendar library, and ideally not specifically
tied to Unix.tm (which requires all the fields to be filled in, often
with weird offsets in some of the members).

-anil

> On 22 Jun 2015, at 11:32, Hannes Mehnert <hannes@xxxxxxxxxxx> wrote:
> 
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA384
> 
> Hi,
> 
> is there a minimal invasive way to refer to Unix.tm inside of a
> library which should also be usable on mirage? I know that mirage
> provides the same type via CLOCK.tm, but I also do not want to depend
> on mirage just for the type.
> 
> I provided sensible default values for validity times of a X.509
> certificate using Unix.tm/gmtime/time -- all of which are also
> available in the mirage CLOCK module type. Is there a way that the
> X.509 library uses these symbols from the Unix module, and mirage
> takes care that they're available (trivial in the non-xen case, in the
> xen case I believe the OCaml runtime from mirage-xen-ocaml needs to be
> modified slightly!?)?
> 
> I cannot come up with clean solutions off the top of my head atm, but
> I'd be glad if there is a simple solution. Maybe a lightweight
> calendar/date library providing functionality such as Unix.tm and
> Unix.gmtime would be sufficient? (ASN.1 combinators already provide
> some basics (float -> t, t -> float where t is similar to Unix.tm):
> https://github.com/mirleft/ocaml-asn1-combinators/blob/master/src/asn_time.mli
> 
> 
> Ideas? Thoughts?
> 
> Hannes
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v2
> 
> iQIcBAEBCQAGBQJVh+QwAAoJELyJZYjffCjuAPgP/11VTH9qu5svePthfNKXsvcZ
> l68pQwont53IpfaIyd3bCTPnUVwBn+dFx39HTRpgXlWv2ZapVXHecna4gTnD+HBp
> gchH5zUyNrvLPRULqzDAOSdAQ1GbDi/o6kq4M4wAtgbXQoTof8d+4rAR4SGuavWX
> ezLvOzKSGH0kNDxodNS/EAQ/oEdjV08aUjUkSxIutLVVDIPlUyl+gZZ37irRyxFF
> 1FB20v7+uW8322Wt6nLffQpN4/7XK9znLqamAMOHfFsbPqPSyHbftyCrJfolR1bu
> DD1CuGkNEP+orX1oDFT4PSFHm6NOhw7CMH1p56cViE4wsNaQpzBQpGVnq/KdQbeK
> 2xijdVc2jf7dW+lY/vCMZmJ5Nz9trV/p1etlCwAUDh0rg5Mm7UKOJ5rkBZDT3bLi
> AexpB8oAD3OKV5GB1pYeJlIGsXHHwK3E3xyOLJjcsnms2SOf4LN/YJjjkYZXCTAX
> 74FPflMkGRRwMXGx4wV/rI3+4f2006utTLAu8vi4lwiPBOhKd4hRSc2schqHtsd5
> P4QI/JM1T6JCO83QP4vZ/MkF75h517Cy9Ek8dD2jc66KgXIKLl1OGZtWaVj3YSgl
> gNxRUD5zuJ8HrsS5xi4YCtdKX/YFMa8pIuNVpuLbap4qby9ciHeiSIRf3CgBcvFC
> CKhTFACgxbzVNHSeCf4a
> =H0g4
> -----END PGP SIGNATURE-----
> 
> _______________________________________________
> MirageOS-devel mailing list
> MirageOS-devel@xxxxxxxxxxxxxxxxxxxx
> http://lists.xenproject.org/cgi-bin/mailman/listinfo/mirageos-devel
> 


_______________________________________________
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®.