[Bug 881] New: OCL's log4cpp uses gettimeofday()

http://bugs.orocos.org/show_bug.cgi?id=881

Summary: OCL's log4cpp uses gettimeofday()
Product: Toolchain
Version: master
Platform: All
OS/Version: Xenomai 2.x
Status: NEW
Severity: major
Priority: P3
Component: OCL
AssignedTo: orocos-dev [..] ...
ReportedBy: peter [..] ...
CC: orocos-dev [..] ...
Estimated Hours: 0.0

log4cpp::TimeStamp uses gettimeofday(), which certainly causes mode
switches in Xenomai applications.

We'll have to refine the code in Orocos/OCL LoggingComponent to use the
TimeStamp::TimeStamp(unsigned int seconds, unsigned int microSeconds)
constructor instead of the default constructor, such that the gettimeofday()
function
is not called by log4cpp.

There is an example here:
http://www.xenomai.org/index.php/Porting_POSIX_applications_to_Xenomai
on how to get the time of day in Xenomai applications using the posix skin.

Since we need other 'time of day' like services, it's probably better to
implement it in the fosi and then use that throughout the toolchain.

- Ideally, the time of day is posix compliant and filled in by TimeService
class, using fosi-specific functions.
This can only be done (for Xenomai) if the TimeService runs a separate thread
that does this synchronisation.

- Xenomai threads must switch to secondary mode in order to call gettimeofday()
- There is notion on the xeno ML that one 'can forcibly emit the syscall like
the clocktest application does.'
- Xenomai 2.6 should implement this feature itself.

Peter