79 lines
1.7 KiB
C
79 lines
1.7 KiB
C
/* timeoldP.h - old base type time_t definition header */
|
|
|
|
/*
|
|
* Copyright (c) 2020-2021, 2023 Wind River Systems, Inc.
|
|
*
|
|
* The right to copy, distribute, modify or otherwise make use
|
|
* of this software may be licensed only pursuant to the terms
|
|
* of an applicable Wind River license agreement.
|
|
*/
|
|
|
|
/*
|
|
modification history
|
|
--------------------
|
|
15sep23,kch Adapted from VxWorks 7
|
|
*/
|
|
|
|
#ifndef __INCtimeoldPh
|
|
#define __INCtimeoldPh
|
|
|
|
#include <vsbConfig.h>
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
/* Macro to copy old timespec structure into new one */
|
|
|
|
#define TS_TO_NEW_FROM_OLD(nts, ots) do { \
|
|
(nts)->tv_sec = (time_t)(ots)->tv_sec; \
|
|
(nts)->tv_nsec = (ots)->tv_nsec; \
|
|
} while (FALSE)
|
|
|
|
/* Macro to copy new timespec structure into old one */
|
|
|
|
#define TS_TO_OLD_FROM_NEW(ots, nts) do { \
|
|
(ots)->tv_sec = (timeold_t)(nts)->tv_sec; \
|
|
(ots)->tv_nsec = (nts)->tv_nsec; \
|
|
} while (FALSE)
|
|
|
|
/* Macro to copy old timeval structure into new one */
|
|
|
|
#define TV_TO_NEW_FROM_OLD(nts, ots) do { \
|
|
(nts)->tv_sec = (time_t)(ots)->tv_sec; \
|
|
(nts)->tv_usec = (ots)->tv_usec; \
|
|
} while (FALSE)
|
|
|
|
/* Macro to copy new timeval structure into old one */
|
|
|
|
#define TV_TO_OLD_FROM_NEW(ots, nts) do { \
|
|
(ots)->tv_sec = (timeold_t)(nts)->tv_sec; \
|
|
(ots)->tv_usec = (nts)->tv_usec; \
|
|
} while (FALSE)
|
|
|
|
typedef long timeold_t;
|
|
|
|
struct timevalOld
|
|
{
|
|
timeold_t tv_sec;
|
|
long tv_usec;
|
|
};
|
|
|
|
struct timespecOld
|
|
{
|
|
timeold_t tv_sec;
|
|
long tv_nsec;
|
|
};
|
|
|
|
struct itimerspecOld
|
|
{
|
|
struct timespecOld it_interval; /* timer period (reload value) */
|
|
struct timespecOld it_value; /* timer expiration */
|
|
};
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif /* __INCtimeoldPh */
|