source: rtems/c/src/exec/posix/src/posixintervaltotimespec.c @ 811fae1

4.104.114.84.95
Last change on this file since 811fae1 was 9f95a19, checked in by Joel Sherrill <joel.sherrill@…>, on 11/02/99 at 18:35:52

Split time.c into multiple files.

  • Property mode set to 100644
File size: 633 bytes
Line 
1/*
2 *  $Id$
3 */
4
5#include <assert.h>
6#include <time.h>
7#include <errno.h>
8
9#include <rtems/system.h>
10#include <rtems/score/isr.h>
11#include <rtems/score/thread.h>
12#include <rtems/score/tod.h>
13
14#include <rtems/posix/seterr.h>
15#include <rtems/posix/time.h>
16
17/*PAGE
18 *
19 *  _POSIX_Interval_to_timespec
20 */
21 
22void _POSIX_Interval_to_timespec(
23  Watchdog_Interval  ticks,
24  struct timespec   *time
25)
26{
27  unsigned32  usecs;
28
29  usecs = ticks * _TOD_Microseconds_per_tick;
30
31  time->tv_sec  = usecs / TOD_MICROSECONDS_PER_SECOND;
32  time->tv_nsec = (usecs % TOD_MICROSECONDS_PER_SECOND) *
33                    TOD_NANOSECONDS_PER_MICROSECOND;
34}
Note: See TracBrowser for help on using the repository browser.