source: rtems/cpukit/posix/src/clockgetres.c @ 9d52e69

4.104.114.84.95
Last change on this file since 9d52e69 was 874297f3, checked in by Ralf Corsepius <ralf.corsepius@…>, on 04/16/04 at 10:01:03

Remove stray white spaces.

  • Property mode set to 100644
File size: 1004 bytes
Line 
1/*
2 *  $Id$
3 */
4
5#if HAVE_CONFIG_H
6#include "config.h"
7#endif
8
9#include <assert.h>
10#include <time.h>
11#include <errno.h>
12
13#include <rtems/system.h>
14#include <rtems/score/isr.h>
15#include <rtems/score/thread.h>
16#include <rtems/score/tod.h>
17
18#include <rtems/seterr.h>
19#include <rtems/posix/time.h>
20
21/*PAGE
22 *
23 *  14.2.1 Clocks, P1003.1b-1993, p. 263
24 */
25
26int clock_getres(
27  clockid_t        clock_id,
28  struct timespec *res
29)
30{
31  if ( !res )
32    rtems_set_errno_and_return_minus_one( EINVAL );
33
34  switch ( clock_id ) {
35
36    /*
37     *  All time in rtems is based on the same clock tick.
38     */
39
40    case CLOCK_REALTIME:
41    case CLOCK_PROCESS_CPUTIME:
42    case CLOCK_THREAD_CPUTIME:
43      if ( res ) {
44        res->tv_sec = _TOD_Microseconds_per_tick / 1000000;
45        res->tv_nsec = _TOD_Microseconds_per_tick * 1000;
46        /* _POSIX_Interval_to_timespec( _TOD_Microseconds_per_tick, res );  */
47      }
48      break;
49
50    default:
51      rtems_set_errno_and_return_minus_one( EINVAL );
52
53  }
54  return 0;
55}
Note: See TracBrowser for help on using the repository browser.