Fork us on GitHub Follow us on Facebook Follow us on Twitter

Opened 6 years ago

Closed 4 years ago

#563 closed defect (fixed)

gettimeofday() has 1-second granularity

Reported by: Jiri Svoboda Owned by:
Priority: major Milestone: 0.7.0
Component: helenos/unspecified Version: mainline
Keywords: Cc:
Blocker for: Depends on:
See also:

Description

It appears that when I call gettimeofday() and a clock device is available (ia32 in Qemu, so that it does not merely call getuptime()), the time returned has 1-second granularity (I always get useconds == 0).

Change History (3)

comment:1 Changed 5 years ago by Jakub Jermář

Milestone: 0.6.00.7.0

comment:2 Changed 4 years ago by Jakub Jermář

This issue is preventing Jainja JVM from working properly:

<guillaum11> I found the reason of the strange behavior of Jainja.
<guillaum11> gettimeofday in uspace/lib/c/generic/time.c has a granularity of 1 second.
<guillaum11> tv->tv_usec is always 0 on my build of HelenOS 0.6
...
<guillaum11> It seems to be voluntary implemented as is:
<guillaum11> tv->tv_usec = 0;
<guillaum11> tv->tv_sec = mktime(&time);
...
<jermar_> guillaum11, what kind of problems is this causing?
<guillaum11> jermar_: green threads doesn't work well because it needs accurate time

comment:3 Changed 4 years ago by Jakub Jermář

Resolution: fixed
Status: newclosed

Fixed in mainline,2302.

Note: See TracTickets for help on using tickets.