diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 1999-11-02 18:35:52 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 1999-11-02 18:35:52 +0000 |
commit | 9f95a19a57f0f85212c320327636e93d70bbecc8 (patch) | |
tree | d62e1fc518777ce07e83994183d0d1b82a7f8a02 /c/src/exec/posix/src/posixintervaltotimespec.c | |
parent | Split condition variables into multiple files. (diff) | |
download | rtems-9f95a19a57f0f85212c320327636e93d70bbecc8.tar.bz2 |
Split time.c into multiple files.
Diffstat (limited to 'c/src/exec/posix/src/posixintervaltotimespec.c')
-rw-r--r-- | c/src/exec/posix/src/posixintervaltotimespec.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/c/src/exec/posix/src/posixintervaltotimespec.c b/c/src/exec/posix/src/posixintervaltotimespec.c new file mode 100644 index 0000000000..e5f883095b --- /dev/null +++ b/c/src/exec/posix/src/posixintervaltotimespec.c @@ -0,0 +1,34 @@ +/* + * $Id$ + */ + +#include <assert.h> +#include <time.h> +#include <errno.h> + +#include <rtems/system.h> +#include <rtems/score/isr.h> +#include <rtems/score/thread.h> +#include <rtems/score/tod.h> + +#include <rtems/posix/seterr.h> +#include <rtems/posix/time.h> + +/*PAGE + * + * _POSIX_Interval_to_timespec + */ + +void _POSIX_Interval_to_timespec( + Watchdog_Interval ticks, + struct timespec *time +) +{ + unsigned32 usecs; + + usecs = ticks * _TOD_Microseconds_per_tick; + + time->tv_sec = usecs / TOD_MICROSECONDS_PER_SECOND; + time->tv_nsec = (usecs % TOD_MICROSECONDS_PER_SECOND) * + TOD_NANOSECONDS_PER_MICROSECOND; +} |