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

Subversion Repositories or1k_old

[/] [or1k_old/] [trunk/] [newlib/] [newlib/] [libc/] [sys/] [rtems/] [include/] [time.h] - Blame information for rev 1782

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 39 lampret
/*
2 56 joel
 *  $Id: time.h,v 1.1.1.2 2000-08-30 19:04:14 joel Exp $
3 39 lampret
 */
4
 
5
 
6
#ifndef __POSIX_TIME_h
7
#define __POSIX_TIME_h
8
 
9 56 joel
#ifdef __cplusplus
10
extern "C" {
11
#endif
12
 
13 39 lampret
#include <sys/features.h>
14
#include "_ansi.h"
15
#include <sys/types.h>
16
#include <sys/time.h>
17
#include <sys/siginfo.h>
18
 
19
/*
20
 *  4.8.1.5 Special Symbol {CLK_TCK}, P1003.1b-1993, p. 97
21
 */
22
 
23
#define CLK_TCK  sysconf(_SC_CLK_TCK)
24
 
25
/*
26
 *  Get size_t from the GNU C version of stddef.h
27
 */
28
 
29
#define __need_size_t
30
#include <stddef.h>
31
 
32
/*
33
 *  ANSI C Time Conversion Structure
34
 *
35
 *  XXX reference
36
 */
37
 
38
struct tm
39
{
40
  int tm_sec;
41
  int tm_min;
42
  int tm_hour;
43
  int tm_mday;
44
  int tm_mon;
45
  int tm_year;
46
  int tm_wday;
47
  int tm_yday;
48
  int tm_isdst;
49
};
50
 
51
/*
52
 *  ANSI C Time Conversion Routines
53
 *
54
 *  XXX reference
55
 */
56
 
57
clock_t    _EXFUN(clock,    (void));
58
double     _EXFUN(difftime, (time_t _time2, time_t _time1));
59
time_t     _EXFUN(mktime,   (struct tm *_timeptr));
60
time_t     _EXFUN(time,     (time_t *_timer));
61
size_t     _EXFUN(strftime,
62
            (char *_s, size_t _maxsize, const char *_fmt, const struct tm *_t));
63
 
64
#ifndef _REENT_ONLY
65
char      *_EXFUN(asctime,  (const struct tm *_tblock));
66
char      *_EXFUN(ctime,    (const time_t *_time));
67
struct tm *_EXFUN(gmtime,   (const time_t *_timer));
68
struct tm *_EXFUN(localtime,(const time_t *_timer));
69
#endif
70
 
71
/*
72
 *  Added by 8.3.5 - 8.3.8, P1002.1c/D10, p. 66-69.
73
 */
74
 
75
char      *_EXFUN(asctime_r,  (const struct tm *, char *));
76
char      *_EXFUN(ctime_r,  (const time_t *, char *));
77
struct tm *_EXFUN(gmtime_r, (const time_t *, struct tm *));
78
struct tm *_EXFUN(localtime_r,  (const time_t *, struct tm *));
79
 
80
/*
81
 *  4.5.1 Get System Time, P1003.1b-1993, p. 91
82
 */
83
 
84
time_t _EXFUN(time, (time_t *tloc));
85
 
86
#if defined(_POSIX_TIMERS)
87
 
88
/*
89
 *  14.2.1 Clocks, P1003.1b-1993, p. 263
90
 */
91
 
92
int _EXFUN(clock_settime, (clockid_t clock_id, const struct timespec *tp));
93
int _EXFUN(clock_gettime, (clockid_t clock_id, struct timespec *tp));
94
int _EXFUN(clock_getres,  (clockid_t clock_id, struct timespec *res));
95
 
96
/*
97
 *  14.2.2 Create a Per-Process Timer, P1003.1b-1993, p. 264
98
 */
99
 
100
int _EXFUN(timer_create,
101
  (clockid_t clock_id, struct sigevent *evp, timer_t *timerid)
102
);
103
 
104
/*
105
 *  14.2.3 Delete a Per_process Timer, P1003.1b-1993, p. 266
106
 */
107
 
108
int _EXFUN(timer_delete, (timer_t timerid));
109
 
110
/*
111
 *  14.2.4 Per-Process Timers, P1003.1b-1993, p. 267
112
 */
113
 
114
int _EXFUN(timer_settime,
115
  (timer_t timerid,
116
   int flags,
117
   const struct itimerspec *value,
118
   struct itimerspec       *ovalue)
119
);
120
 
121
int _EXFUN(timer_gettime, (timer_t timerid, struct itimerspec *value));
122
int _EXFUN(timer_getoverrun, (timer_t timerid));
123
 
124
/*
125
 *  14.2.5 High Resolution Sleep, P1003.1b-1993, p. 269
126
 */
127
 
128
int _EXFUN(nanosleep, (const struct timespec  *rqtp, struct timespec *rmtp));
129
 
130
#endif /* _POSIX_TIMERS */
131
 
132
/*
133
 *  20.1.1 CPU-time Clock Attributes, P1003.4b/D8, p. 54
134
 */
135
 
136
/* values for the clock enable attribute */
137
 
138
#define CLOCK_ENABLED  1  /* clock is enabled, i.e. counting execution time */
139
#define CLOCK_DISABLED 0  /* clock is disabled */
140
 
141
/* values for the pthread cputime_clock_allowed attribute */
142
 
143
#define CLOCK_ALLOWED    1 /* If a thread is created with this value a */
144
                           /*   CPU-time clock attached to that thread */
145
                           /*   shall be accessible. */
146
#define CLOCK_DISALLOWED 0 /* If a thread is created with this value, the */
147
                           /*   thread shall not have a CPU-time clock */
148
                           /*   accessible. */
149
 
150
/*
151
 *  14.1.3 Manifest Constants, P1003.1b-1993, p. 262
152
 */
153
 
154
#define CLOCK_REALTIME (clockid_t)1
155
 
156
/*
157
 *  Flag indicating time is "absolute" with respect to the clock
158
 *  associated with a time
159
 */
160
 
161
#define TIMER_ABSTIME  4
162
 
163
/*
164
 *  20.1.2 Manifest Constants, P1003.4b/D8, p. 55
165
 */
166
 
167
#if defined(_POSIX_CPUTIME)
168
 
169
/*
170
 *  When used in a clock or timer function call, this is interpreted as
171
 *  the identifier of the CPU_time clock associated with the PROCESS
172
 *  making the function call.
173
 */
174
 
175
#define CLOCK_PROCESS_CPUTIME (clockid_t)2
176
 
177
#endif
178
 
179
#if defined(_POSIX_THREAD_CPUTIME)
180
 
181
/*
182
 *  When used in a clock or timer function call, this is interpreted as
183
 *  the identifier of the CPU_time clock associated with the THREAD
184
 *  making the function call.
185
 */
186
 
187
#define CLOCK_THREAD_CPUTIME (clockid_t)3
188
 
189
#endif
190
 
191
#if defined(_POSIX_CPUTIME)
192
 
193
/*
194
 *  20.1.3 Accessing a Process CPU-time CLock, P1003.4b/D8, p. 55
195
 */
196
 
197
int _EXFUN(clock_getcpuclockid, (pid_t pid, clockid_t *clock_id));
198
 
199
#endif /* _POSIX_CPUTIME */
200
 
201
#if defined(_POSIX_CPUTIME) || defined(_POSIX_THREAD_CPUTIME)
202
 
203
/*
204
 *  20.1.5 CPU-time Clock Attribute Access, P1003.4b/D8, p. 56
205
 */
206
 
207
int _EXFUN(clock_setenable_attr, (clockid_t clock_id, int attr));
208
 
209
int _EXFUN(clock_getenable_attr, (clockid_t clock_id, int *attr));
210
 
211
#endif /* _POSIX_CPUTIME or _POSIX_THREAD_CPUTIME */
212
 
213
#ifdef __cplusplus
214
}
215
#endif
216
 
217
#endif
218
/* end of include file */

powered by: WebSVN 2.1.0

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