diff options
| author | rpj <rpj> | 2007-11-22 14:14:57 +0000 | 
|---|---|---|
| committer | rpj <rpj> | 2007-11-22 14:14:57 +0000 | 
| commit | 25ffdcfc06e8a84497fd7e80aa4cef111d7dad2d (patch) | |
| tree | e1a03422251b1556d6770458edf71a5475f7cf36 /pthread.h | |
| parent | b1dc8324d03053ffb427424c8de046863757d8ec (diff) | |
''
Diffstat (limited to 'pthread.h')
| -rw-r--r-- | pthread.h | 16 | 
1 files changed, 11 insertions, 5 deletions
@@ -305,7 +305,7 @@ enum {  #ifndef HAVE_STRUCT_TIMESPEC  #define HAVE_STRUCT_TIMESPEC 1  struct timespec { -        long tv_sec; +        time_t tv_sec;          long tv_nsec;  };  #endif /* HAVE_STRUCT_TIMESPEC */ @@ -1249,13 +1249,19 @@ PTW32_DLLPORT int PTW32_CDECL pthreadCancelableTimedWait (HANDLE waitHandle,          ( strcpy( (_buf), ctime( (_clock) ) ),  \            (_buf) ) +/* + * gmtime(tm) and localtime(tm) return 0 if tm represents + * a time prior to 1/1/1970. + */  #define gmtime_r( _clock, _result ) \ -        ( *(_result) = *gmtime( (_clock) ), \ -          (_result) ) +        ( gmtime( (_clock) ) \ +             ? (*(_result) = *gmtime( (_clock) ), (_result) ) \ +             : (0) )  #define localtime_r( _clock, _result ) \ -        ( *(_result) = *localtime( (_clock) ), \ -          (_result) ) +        ( localtime( (_clock) ) \ +             ? (*(_result) = *localtime( (_clock) ), (_result) ) \ +             : (0) )  #define rand_r( _seed ) \          ( _seed == _seed? rand() : rand() )  | 
