summaryrefslogtreecommitdiffstats
path: root/cpukit/posix/include/rtems/posix/time.h
blob: 446d40c02e8b5da7b97902b59fc006f62f6027ec (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/**
 * @file rtems/posix/time.h
 */

/*
 *
 *
 *  $Id$
 */

#ifndef __RTEMS_POSIX_TIME_h
#define __RTEMS_POSIX_TIME_h

#include <rtems/score/tod.h>

/*
 *  Seconds from January 1, 1970 to January 1, 1988.  Used to account for
 *  differences between POSIX API and RTEMS core.
 */

#define POSIX_TIME_SECONDS_1970_THROUGH_1988 \
  (((1987 - 1970 + 1)  * TOD_SECONDS_PER_NON_LEAP_YEAR) + \
  (4 * TOD_SECONDS_PER_DAY))

/*PAGE
 *
 *  _POSIX_Timespec_subtract
 */

void _POSIX_Timespec_subtract(
  const struct timespec *the_start,
  const struct timespec *end,
  struct timespec *result
);

/*
 *  _POSIX_Timespec_to_interval
 */

Watchdog_Interval _POSIX_Timespec_to_interval(
  const struct timespec *time
);

/*PAGE
 *
 *  _POSIX_Interval_to_timespec
 */

void _POSIX_Interval_to_timespec(
  Watchdog_Interval  ticks,
  struct timespec   *time
);

#endif