Opened 10 years ago

Last modified 6 years ago

#2956 new Patches

vxWorks POSIX quirks for date_time

Reported by: Dustin Spicuzza <dustin@…> Owned by: az_sw_dude
Milestone: Boost 1.39.0 Component: date_time
Version: Boost 1.38.0 Severity: Problem
Keywords: Cc:

Description

vxWorks is almost a unix-like platform, that supports the POSIX realtime extensions and a lot of POSIX stuff.. but its weird.

It apparently doesn't support gettimeofday. I modified microsec_time_clock to support a situation where gettimeofday isn't available but clock_gettime is.

vxWorks has localtime_r, but it is defined as "extern int localtime_r (const time_t *_tod, struct tm *_result);"... so it needs some hand holding to work correctly. same with gmtime_r

Of course, this patch also requires the user to setup a config that defines BOOST_HAS_CLOCK_GETTIME, but I'm going to submit a separate patch for vxWorks platform config

Attachments (1)

boost_1_38_0.date_time.vxworks.patch (3.0 KB) - added by Dustin Spicuzza <dustin@…> 10 years ago.

Download all attachments as: .zip

Change History (5)

Changed 10 years ago by Dustin Spicuzza <dustin@…>

comment:1 Changed 10 years ago by Dustin Spicuzza <dustin@…>

Type: BugsPatches

comment:2 Changed 10 years ago by Dustin Spicuzza <dustin@…>

This is a pretty trivial patch, do you think you could take a look at it at some point?

comment:3 Changed 8 years ago by viboes

I see a possible problem with this patch.

Adding a new config macro need to provide a test also. I gues we can change

        result = localtime_r(t, result); 

by

        (void)localtime_r(t, result); 

without too much trouble

comment:4 Changed 6 years ago by viboes

Severity: ShowstopperProblem
Note: See TracTickets for help on using tickets.