Xenomai  3.1-devel
time.h
1 /*
2  * Copyright (C) 2005 Philippe Gerum <rpm@xenomai.org>.
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
17  */
18 #pragma GCC system_header
19 #include_next <time.h>
20 
21 #ifndef _COBALT_TIME_H
22 #define _COBALT_TIME_H
23 
24 /* Re-read in case we came from selective __need* block. */
25 #include_next <time.h>
26 #include <cobalt/wrappers.h>
27 #include <cobalt/uapi/time.h>
28 
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32 
33 COBALT_DECL(int, clock_getres(clockid_t clock_id,
34  struct timespec *tp));
35 
36 COBALT_DECL(int, clock_gettime(clockid_t clock_id,
37  struct timespec *tp));
38 
39 COBALT_DECL(int, clock_settime(clockid_t clock_id,
40  const struct timespec *tp));
41 
42 COBALT_DECL(int, clock_adjtime(clockid_t clock_id,
43  struct timex *tx));
44 
45 COBALT_DECL(int, clock_nanosleep(clockid_t clock_id,
46  int flags,
47  const struct timespec *rqtp,
48  struct timespec *rmtp));
49 
50 COBALT_DECL(time_t, time(time_t *t));
51 
52 COBALT_DECL(int, nanosleep(const struct timespec *rqtp,
53  struct timespec *rmtp));
54 
55 COBALT_DECL(int, timer_create(clockid_t clockid,
56  const struct sigevent *__restrict__ evp,
57  timer_t * __restrict__ timerid));
58 
59 COBALT_DECL(int, timer_delete(timer_t timerid));
60 
61 COBALT_DECL(int, timer_settime(timer_t timerid,
62  int flags,
63  const struct itimerspec *value,
64  struct itimerspec *ovalue));
65 
66 COBALT_DECL(int, timer_gettime(timer_t timerid,
67  struct itimerspec *value));
68 
69 COBALT_DECL(int, timer_getoverrun(timer_t timerid));
70 
71 #ifdef __cplusplus
72 }
73 #endif
74 
75 #endif /* !_COBALT_TIME_H */
int timer_create(clockid_t clockid, const struct sigevent *__restrict__ evp, timer_t *__restrict__ timerid)
Create a timer.
Definition: timer.c:74
int clock_getres(clockid_t clock_id, struct timespec *tp)
Get the resolution of the specified clock.
Definition: clock.c:100
int timer_gettime(timer_t timerid, struct itimerspec *value)
Get timer next expiration date and reload value.
Definition: timer.c:208
int timer_delete(timer_t timerid)
Delete a timer object.
Definition: timer.c:105
int timer_getoverrun(timer_t timerid)
Get expiration overruns count since the most recent timer expiration signal delivery.
Definition: timer.c:242
int timer_settime(timer_t timerid, int flags, const struct itimerspec *__restrict__ value, struct itimerspec *__restrict__ ovalue)
Start or stop a timer.
Definition: timer.c:165
int clock_settime(clockid_t clock_id, const struct timespec *tp)
Set the specified clock.
Definition: clock.c:236
int nanosleep(const struct timespec *rqtp, struct timespec *rmtp)
Sleep some amount of time.
Definition: clock.c:350
int clock_gettime(clockid_t clock_id, struct timespec *tp)
Read the specified clock.
Definition: clock.c:181
int clock_nanosleep(clockid_t clock_id, int flags, const struct timespec *rqtp, struct timespec *rmtp)
Sleep some amount of time.
Definition: clock.c:306