-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Open
Labels
Area: POSIXArea: POSIX API wrapperArea: POSIX API wrapperArea: timersArea: timer subsystemsArea: timer subsystemsType: bugThe issue reports a bug / The PR fixes a bug (including spelling errors)The issue reports a bug / The PR fixes a bug (including spelling errors)
Description
Description
PR #4286 added support for gettimeofday() by implementing it on top of xtimer_now_usec64().
This definition is in conflict with the specification, which says:
The gettimeofday() function shall obtain the current time, expressed as seconds and microseconds since the Epoch, and store it in the timeval structure pointed to by tp. The resolution of the system clock is unspecified.
Expected results
The current wall time is returned (if the board has a RTC). Otherwise, either the function should be made unavailable (this triggering a linker error if it is used), or it should always fail.
Actual results
gettimeofday() returns time since boot if xtimer was compiled in. If not, it fails with ENOSYS.
Related to
issue: #10523
Metadata
Metadata
Assignees
Labels
Area: POSIXArea: POSIX API wrapperArea: POSIX API wrapperArea: timersArea: timer subsystemsArea: timer subsystemsType: bugThe issue reports a bug / The PR fixes a bug (including spelling errors)The issue reports a bug / The PR fixes a bug (including spelling errors)