OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [rtems/] [c/] [src/] [exec/] [posix/] [src/] [time.c] - Blame information for rev 30

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 30 unneback
/*
2
 *  $Id: time.c,v 1.2 2001-09-27 11:59:17 chris Exp $
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
 *  4.5.1 Get System Time, P1003.1b-1993, p. 91
20
 */
21
 
22
/* Using the implementation in newlib */
23
#if 0
24
time_t time(
25
  time_t   *tloc
26
)
27
{
28
  time_t  seconds_since_epoch;
29
 
30
  /*
31
   *  No error is the time of day is not set.   For RTEMS the system time
32
   *  starts out at the rtems epoch.
33
   */
34
 
35
  /*
36
   *  Internally the RTEMS epoch is 1988.  This must be taken into account.
37
   */
38
 
39
  seconds_since_epoch = _TOD_Seconds_since_epoch;
40
 
41
  seconds_since_epoch += POSIX_TIME_SECONDS_1970_THROUGH_1988;
42
 
43
  if ( tloc )
44
    *tloc = seconds_since_epoch;
45
 
46
  return seconds_since_epoch;
47
}
48
#endif

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.